In the general case, this would require a new method on compound queries
to sort themselves into a "canonical" order, or refuse to. Somehow, I
don't think this will happen. However, it could be done with boolean
queries only, which would make it somewhat easier to combinatorically
compose OR filter queries from a base set.
Jonathan Rochkind wrote:
Those two queries might NOT always be 'the same', depending on how you
have your Solr request handler set up.
For instance, if you have dismax with a ps boost, then "two one" may
end up with different relevancy scores than "one two", because the
query as a phrase will be used for boosting, and those are two
different phrases. That isn't the only example.
In general, I think this isn't a Solr issue, it depends on the
semantics of your app and setup, and you've just got to write code in
the language of your choice to determine if two q strings are 'the
same' for your purposes.
Jonathan
dan sutton wrote:
What I wanted was a was to determine that simply the query q="one
two" is
equivalent to q="two one", by normalizing I might have
q="one two" for both for example, and then the q.hashCode() would be the
same
Simply using q.hashCode() returns different values for each query
above so
this is not suitable
Cheers
Dan
On Thu, Sep 9, 2010 at 3:36 PM, Markus Jelsma
<markus.jel...@buyways.nl>wrote:
LuceneQParser
http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Proximity%20Searches
DismaxQParser
http://wiki.apache.org/solr/DisMaxQParserPlugin#qs_.28Query_Phrase_Slop.29
On Thursday 09 September 2010 15:08:41 dan sutton wrote:
Hi,
Does anyone know how I might normalized a query so that e.g. q="one
two"
equals q="two one"
Cheers,
Dan
Markus Jelsma - Technisch Architect - Buyways BV
http://www.linkedin.com/in/markus17
050-8536620 / 06-50258350