I've looked at solr local params. However, I can't figure out how to integrate it with my full text search using dismax handler. Here is my full text search request handler.
<requestHandler name="mb_listings" class="solr.SearchHandler"> <lst name="defaults"> <str name="echoParams">explicit</str> <int name="rows">20</int> <str name="defType">dismax</str> <str name="qf">name_ngram^20 name^40 postal_code address description long_description location keyphrase short_description category telephone email website</str> <str name="pf">name_ngram</str> <str name="bf">fap^10</str> <str name="fl">uuid</str> <str name="version">2.2</str> <str name="indent">on</str> <str name="tie">0.1</str> </lst> <lst name="appends"> <str name="fq">type:Listing</str> </lst> <lst name="invariants"> <str name="facet">false</str> </lst> <arr name="last-components"> <str>spellcheck</str> <str>elevateListings</str> </arr> </requestHandler> Note: postal_code, keyphrase, category, telephone, email, website has field type "text_keyword". Thanks On Sat, Nov 20, 2010 at 9:49 AM, Yonik Seeley <yo...@lucidimagination.com>wrote: > On Fri, Nov 19, 2010 at 9:41 PM, Chamnap Chhorn <chamnapchh...@gmail.com> > wrote: > > Wow, i never know this syntax before. What's that called? > > I dubbed it "local params" since it adds local info to a parameter > (think extra metadata, like XML attributes on an element). > > http://wiki.apache.org/solr/LocalParams > > It's used mostly to invoke different query parsers, but it's also used > to add extra metadata to faceting commands too (and is required for > stuff like multi-select faceting): > > > http://wiki.apache.org/solr/SimpleFacetParameters#Multi-Select_Faceting_and_LocalParams > > > -Yonik > http://www.lucidimagination.com > > > > > On 11/19/10, Yonik Seeley <yo...@lucidimagination.com> wrote: > >> On Tue, Nov 16, 2010 at 10:28 PM, Chamnap Chhorn > >> <chamnapchh...@gmail.com> wrote: > >>> I have one question related to single word token with dismax query. In > >>> order > >>> to be found I need to add the quote around the search query all the > time. > >>> This is quite hard for me to do since it is part of full text search. > >>> > >>> Here is my solr query and field type definition (Solr 1.4): > >>> <fieldType name="text_keyword" class="solr.TextField" > >>> positionIncrementGap="100"> > >>> <analyzer> > >>> <tokenizer class="solr.KeywordTokenizerFactory"/> > >>> <filter class="solr.LowerCaseFilterFactory" /> > >>> <filter class="solr.TrimFilterFactory" /> > >>> <filter class="solr.StopFilterFactory" ignoreCase="true" > >>> words="stopwords.txt" enablePositionIncrements="true"/> > >>> <filter class="solr.SynonymFilterFactory" > synonyms="synonyms.txt" > >>> ignoreCase="true" expand="false" /> > >>> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> > >>> </analyzer> > >>> </fieldType> > >>> > >>> <field name="keyphrase" type="text_keyword" indexed="true" > >>> stored="false" multiValued="true"/> > >>> > >>> With this query > >>> q=smart%20mobile&qf=keyphrase&debugQuery=on&defType=dismax, > >>> solr returns nothing. However, with quote on the search query q="smart > >>> mobile"&qf=keyphrase&debugQuery=on&defType=dismax, the result is found. > >>> > >>> Is it a must to use quote for a single word token field? > >> > >> Yes, you must currently quote tokens if they contain whitespace - > >> otherwise the query parser first breaks on whitespace before doing > >> analysis on each part separately. > >> > >> Using dismax is an odd choice if you are only querying on keyphrase > though. > >> You might look at the field query parser - it is a basic single-field > >> single-value parser with no operators (hence no need to escape any > >> special characters). > >> > >> q={!field f=keyphrase}smart%20mobile > >> > >> or you can decompose it using param dereferencing (sometimes easier to > >> construct) > >> > >> q={!field f=keyphrase v=$qq}&qq=smart%20mobile > >> > >> -Yonik > >> http://www.lucidimagination.com > >> > > > > -- > > Sent from my mobile device > > > > Chhorn Chamnap > > http://chamnapchhorn.blogspot.com/ > > > -- Chhorn Chamnap http://chamnapchhorn.blogspot.com/