[ 
https://issues.apache.org/jira/browse/SOLR-5683?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Areek Zillur updated SOLR-5683:
-------------------------------

    Description: 
Place holder for documentation that will eventually end up in the Solr Ref 
guide.
====
The new Suggester Component allows Solr to fully utilize the Lucene suggesters. 
The main features are:
- lookup pluggability (TODO: add description):
  -- AnalyzingInfixLookupFactory
  -- AnalyzingLookupFactory
  -- FuzzyLookupFactory
  -- FreeTextLookupFactory
  -- FSTLookupFactory
  -- WFSTLookupFactory
  -- TSTLookupFactory
  --  JaspellLookupFactory
   - Dictionary pluggability (give users the option to choose the dictionary 
implementation to use for their suggesters to consume)
   -- Input from search index
      --- DocumentDictionaryFactory – user can specify suggestion field along 
with optional weight and payload fields from their search index.
      --- DocumentExpressionFactory – same as DocumentDictionaryFactory but 
allows users to specify arbitrary expression using existing numeric fields.
     --- HighFrequencyDictionaryFactory – user can specify a suggestion field 
and specify a threshold to prune out less frequent terms. 
   -- Input from external files
     --- FileDictionaryFactory – user can specify a file which contains suggest 
entries, along with optional weights and payloads.

Config (index time) options:
  - name - name of suggester
  - sourceLocation - external file location (for file-based suggesters)
  - lookupImpl - type of lookup to use [default JaspellLookupFactory]
  - dictionaryImpl - type of dictionary to use (lookup input) [default
    (sourceLocation == null ? HighFrequencyDictionaryFactory : 
FileDictionaryFactory)]
  - storeDir - location to store in-memory data structure in disk
  - buildOnCommit - command to build suggester for every commit
  - buildOnOptimize - command to build suggester for every optimize



Query time options:
  - suggest.dictionary - name of suggester to use (can occur multiple times for 
batching suggester requests)
  - suggest.count - number of suggestions to return
  - suggest.q - query to use for lookup
  - suggest.build - command to build the suggester
  - suggest.reload - command to reload the suggester
  - buildAll – command to build all suggesters in the component
  - reloadAll – command to reload all suggesters in the component


Example query:
{code}
http://localhost:8983/solr/suggest?suggest.dictionary=suggester1&suggest=true&suggest.build=true&suggest.q=elec
{code}
Distributed query:
{code}
http://localhost:7574/solr/suggest?suggest.dictionary=suggester2&suggest=true&suggest.build=true&suggest.q=elec&shards=localhost:8983/solr,localhost:7574/solr&shards.qt=/suggest
{code}  
Response Format:
The response format can be either XML or JSON. The typical response structure 
is as follows:
 {code}
{
  suggest: {
    suggester_name: {
       suggest_query: { numFound:  .., suggestions: [ {term: .., weight: .., 
payload: ..}, .. ]} 
   }
}       
{code}
  




Example Response:
{code}
{
    responseHeader: {
        status: 0,
        QTime: 3
    },
    suggest: {
        suggester1: {
            e: {
                numFound: 1,
                suggestions: [
                    {
                        term: "electronics and computer1",
                        weight: 100,
                        payload: ""
                    }
                ]
            }
        },
        suggester2: {
            e: {
                numFound: 1,
                suggestions: [
                    {
                        term: "electronics and computer1",
                        weight: 10,
                        payload: ""
                    }
                ]
            }
        }
    }
}
{code}

Example solrconfig snippet with multiple suggester configuration:
{code}  
  <searchComponent name="suggest" class="solr.SuggestComponent">
    <lst name="suggester">
      <str name="name">suggester1</str>
      <str name="lookupImpl">FuzzyLookupFactory</str>      
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>      
      <str name="field">cat</str>
      <str name="weightField">price</str>
      <str name="suggestAnalyzerFieldType">string</str>
    </lst>
   <lst name="suggester">
        <str name="name">suggester2 </str>
        <str name="dictionaryImpl">DocumentExpressionDictionaryFactory</str>
        <str name="lookupImpl">FuzzyLookupFactory</str>
        <str name="field">product_name</str>
        <str name="weightExpression">((price * 2) + ln(popularity))</str>
        <str name="sortField">weight</str>
        <str name="sortField">price</str>
        <str name="strtoreDir">suggest_fuzzy_doc_expr_dict</str>
        <str name="suggestAnalyzerFieldType">text</str>
      </lst>  
</searchComponent>
{code}


  was:Place holder for documentation that will eventually end up in the Solr 
Ref guide.


> Documentation of Suggester V2
> -----------------------------
>
>                 Key: SOLR-5683
>                 URL: https://issues.apache.org/jira/browse/SOLR-5683
>             Project: Solr
>          Issue Type: Task
>          Components: SearchComponents - other
>            Reporter: Areek Zillur
>            Assignee: Areek Zillur
>             Fix For: 5.0, 4.7
>
>
> Place holder for documentation that will eventually end up in the Solr Ref 
> guide.
> ====
> The new Suggester Component allows Solr to fully utilize the Lucene 
> suggesters. 
> The main features are:
> - lookup pluggability (TODO: add description):
>   -- AnalyzingInfixLookupFactory
>   -- AnalyzingLookupFactory
>   -- FuzzyLookupFactory
>   -- FreeTextLookupFactory
>   -- FSTLookupFactory
>   -- WFSTLookupFactory
>   -- TSTLookupFactory
>   --  JaspellLookupFactory
>    - Dictionary pluggability (give users the option to choose the dictionary 
> implementation to use for their suggesters to consume)
>    -- Input from search index
>       --- DocumentDictionaryFactory – user can specify suggestion field along 
> with optional weight and payload fields from their search index.
>       --- DocumentExpressionFactory – same as DocumentDictionaryFactory but 
> allows users to specify arbitrary expression using existing numeric fields.
>      --- HighFrequencyDictionaryFactory – user can specify a suggestion field 
> and specify a threshold to prune out less frequent terms.       
>    -- Input from external files
>      --- FileDictionaryFactory – user can specify a file which contains 
> suggest entries, along with optional weights and payloads.
> Config (index time) options:
>   - name - name of suggester
>   - sourceLocation - external file location (for file-based suggesters)
>   - lookupImpl - type of lookup to use [default JaspellLookupFactory]
>   - dictionaryImpl - type of dictionary to use (lookup input) [default
>     (sourceLocation == null ? HighFrequencyDictionaryFactory : 
> FileDictionaryFactory)]
>   - storeDir - location to store in-memory data structure in disk
>   - buildOnCommit - command to build suggester for every commit
>   - buildOnOptimize - command to build suggester for every optimize
> Query time options:
>   - suggest.dictionary - name of suggester to use (can occur multiple times 
> for batching suggester requests)
>   - suggest.count - number of suggestions to return
>   - suggest.q - query to use for lookup
>   - suggest.build - command to build the suggester
>   - suggest.reload - command to reload the suggester
>   - buildAll – command to build all suggesters in the component
>   - reloadAll – command to reload all suggesters in the component
> Example query:
> {code}
> http://localhost:8983/solr/suggest?suggest.dictionary=suggester1&suggest=true&suggest.build=true&suggest.q=elec
> {code}
> Distributed query:
> {code}
> http://localhost:7574/solr/suggest?suggest.dictionary=suggester2&suggest=true&suggest.build=true&suggest.q=elec&shards=localhost:8983/solr,localhost:7574/solr&shards.qt=/suggest
> {code}        
> Response Format:
> The response format can be either XML or JSON. The typical response structure 
> is as follows:
>  {code}
> {
>   suggest: {
>     suggester_name: {
>        suggest_query: { numFound:  .., suggestions: [ {term: .., weight: .., 
> payload: ..}, .. ]} 
>    }
> }     
> {code}
>   
> Example Response:
> {code}
> {
>     responseHeader: {
>         status: 0,
>         QTime: 3
>     },
>     suggest: {
>         suggester1: {
>             e: {
>                 numFound: 1,
>                 suggestions: [
>                     {
>                         term: "electronics and computer1",
>                         weight: 100,
>                         payload: ""
>                     }
>                 ]
>             }
>         },
>         suggester2: {
>             e: {
>                 numFound: 1,
>                 suggestions: [
>                     {
>                         term: "electronics and computer1",
>                         weight: 10,
>                         payload: ""
>                     }
>                 ]
>             }
>         }
>     }
> }
> {code}
> Example solrconfig snippet with multiple suggester configuration:
> {code}  
>   <searchComponent name="suggest" class="solr.SuggestComponent">
>     <lst name="suggester">
>       <str name="name">suggester1</str>
>       <str name="lookupImpl">FuzzyLookupFactory</str>      
>       <str name="dictionaryImpl">DocumentDictionaryFactory</str>      
>       <str name="field">cat</str>
>       <str name="weightField">price</str>
>       <str name="suggestAnalyzerFieldType">string</str>
>     </lst>
>    <lst name="suggester">
>         <str name="name">suggester2 </str>
>         <str name="dictionaryImpl">DocumentExpressionDictionaryFactory</str>
>         <str name="lookupImpl">FuzzyLookupFactory</str>
>         <str name="field">product_name</str>
>         <str name="weightExpression">((price * 2) + ln(popularity))</str>
>         <str name="sortField">weight</str>
>         <str name="sortField">price</str>
>         <str name="strtoreDir">suggest_fuzzy_doc_expr_dict</str>
>         <str name="suggestAnalyzerFieldType">text</str>
>       </lst>  
> </searchComponent>
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to