Introduction to how to use suggest to add automatic prompting features in SOLR

Source: Internet
Author: User
Tags solr

Suggest is a convenient function of the search engine, the key words of the data to make predictions and suggestions, reduce the user's input, the overall effect is as follows:

Fortunately, SOLR also provides similar functionality, which, on the basis of this feature, can be implemented in conjunction with JQuery or Kissy's auto-complete components.
The process for starting this feature is generally as follows:
The functionality of the suggest depends on the spelling component, and there is a spellchecker directory under the Solr_home/data directory, which is used to store the index library for suggest and spell checking, so configure the spell feature first, configured as follows:

In Solrconfig.xml, add the following configuration:

<searchcomponent name= "spellcheck" class= "SOLR. Spellcheckcomponent ">   <str name=" Queryanalyzerfieldtype ">text_ik</str>   <lst name=" Spellchecker ">    <str name=" name ">default</str>    <str name=" field ">suggestion</str >    <str name= "Buildoncommit" >true</str>    <str name= "Spellcheckindexdir" >spellchecker </str>   </lst></searchComponent>

the fie in the above The ld is used to specify the data from the primary index library for the spellchecker index to be obtained from that field in the primary index library. Buildoncommit This property is true, the contents of the specified field are automatically sent to the Spellchecker Index library for spell checking and suggest use when the primary index library has a commit instruction.

Next, configure the processing and request classes for suggest as follows:

At this time resubmit the data, you will find that the original empty spellchecker empty index library has data, and then open a URL like this (please change the value of q= in the title field)

HTTP://localhost:8983/solr/suggest/?q=%e7%94%9f

Introduction to how to use suggest to add automatic prompting features in SOLR

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.