lucene - solr search with keywords having space not giving proper results -


i have list of keywords few of them below

cheap hotels dubai hotel extended hotel .... ..

i have store(storename:hotelsstore) , added keywords above(which have white space) store , doing solr indexing. if search "cheap hotels" store:hotelsstore not showing reults.

but if add "cheaphotels" without space , indexing. if search "cheaphotels" desired store(hotelsstore) showing in results.

note: using lucene 5.4 , solr 5.4.

please me on this.

thanks, syamala.

try generate word parts using worddelimiterfilter filter on storename field.

you customise filter how want.

just example:

one way of doing specify generatewordparts="1" catenatewords="1" in analyzer used indexing, , generatewordparts="1" in analyzer used querying. given current standardtokenizer removes many intra-word delimiters, recommended filter used after tokenizer leaves them in place (such whitespacetokenizer).

<tokenizer class="solr.whitespacetokenizerfactory"/>       <filter class="solr.worddelimiterfilterfactory"             generatewordparts="1"             generatenumberparts="1"             catenatewords="1"             catenatenumbers="1"             catenateall="0"             preserveoriginal="1"             /> 

generate_word_parts set 1

causes parts of words generated:  "hotelsstore" => "hotel" "store" 

https://lucene.apache.org/core/4_4_0/analyzers-common/org/apache/lucene/analysis/miscellaneous/worddelimiterfilter.html


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -