<!--
`nuxeo-embedding-search-search-form`
@group Nuxeo UI
@element nuxeo-embedding-search-search-form
-->
<dom-module id="nuxeo-embedding-search-search-form">
  <template>
    <style include="nuxeo-styles">
    </style>

    <nuxeo-input
                 role="widget"
                 id="searchInput"
                 type="search"
                 label="What is it you are looking for?"
                 value="{{params.input_text}}"
                 autofocus>
    </nuxeo-input>
    
    <nuxeo-input
                 role="widget"
                 id="minScore"
                 type="number"
                 min="0"
                 max="1"
                 step="0.01"
                 label="Min Score"
                 value="{{params.min_score}}"
                 placeholder="0.4">

    </nuxeo-input>
    
    
  </template>

  <script>
    Polymer({
      is: 'nuxeo-embedding-search-search-form',
      behaviors: [Nuxeo.LayoutBehavior],
      properties: {

        params: {
          type: Object,
          notify: true,
        },
        
        searchTerm: {
          type: String,
          notify: true,
        },

        aggregations: {
          type: Object,
          value: {},
          notify: true,
        }

      }, 
      
      validate() {
        this.set('params.vector_index', "embedding:image");
        this.set('params.embedding_automation_processor','javascript.text2embedding');
        this.set('params.k',"10");
        return true
      }
      
    });
  </script>
</dom-module>
