You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Aman Tandon <am...@gmail.com> on 2015/05/28 15:47:20 UTC

Guidance needed to modify ExtendedDismaxQParserPlugin

Hi,

*Problem Statement: *query -> "i need leather jute bags"

If we are searching on the *title *field using the pf2 (
*server:8003/solr/core0/select?q=i%20need%20leather%20jute%20bags&pf2=titlex&debug=query&defType=edismax&wt=xml&rows=0*).
Currently it will create the shingled phrases like "i need", "need
leather", "leather jute", "jute bags".


>
> *<str name="parsedquery_toString">+(((title:i)~0.01 (title:need)~0.01
> (title:leather)~0.01 (title:jute)~0.01 (title:bag)~0.01)~3) ((titlex:"i
> need")~0.01 (titlex:"need leather")~0.01 (titlex:"leather jute")~0.01
> (titlex:"jute bag")~0.01)</str>*


*Requirement: *

I want to customize the ExtendedDismaxQParserPlugin to generate custom
phrase queries on pf2. I want to create the phrase tokens like "jute bags",
"leather jute bags"

So the irrelevant tokens like "*i need*", "*need leather*" didn't match any
search results. Because in most of the scenarios in our business, we
observed (from Google Analytics) that last two words are more important in
the query.

So I need to generate only these two tokens by calling my xyz function
instead of calling the function *addShingledPhraseQueries. *Please guide me
here.

Should I modify the same java class or create another class. And In case of
another class how and where should I need to define our customized *defType*
.

With Regards
Aman Tandon