Simple Solr schema problem for autocomplete

后端 未结 2 1057
死守一世寂寞
死守一世寂寞 2021-01-03 10:32

I have a very simple SQL table that I want to import into Solr but because of the features I want for search I can\'t determine the best schema.

The user will start

相关标签:
2条回答
  • 2021-01-03 10:42

    You can implement this using either facet.prefix, TermsComponent or NGrams.

    One of those articles also shows how to bind it using jQuery or you could use ajax-solr.

    By the way, a specific autosuggest component is to be included in the next release of Solr.

    0 讨论(0)
  • 2021-01-03 11:04

    what do you want to know exactly?

    if your question is how to get your data there? easiest way is posting xml files....

    how do you define your schema.xml? you dont have to, there are pre-defined wildcard fields for strings, they end with _s i think.

    how do you form the query?... well as easy as myfield_string:"boa*"

    obviously xml? why? json is smaller and just as good for this purpose!

    have you checked out the official tutorial? http://lucene.apache.org/solr/tutorial.html

    do you want to do an autosuggesting for words or whole documents?

    first is very easy. solr even has its very optimized handler for that. check out this tutorial: http://www.mattweber.org/2009/05/02/solr-autosuggest-with-termscomponent-and-jquery/

    second one gets more interesting. what if someone types "collection of boats" or something like that? i personally would recommend using dismax handler with a wildcard at the end for autosuggesting. then words are in logical OR conjunction and the not finished word is matched at the beginning...

    0 讨论(0)
提交回复
热议问题