MultiPhraseQuery and .equals()

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

MultiPhraseQuery and .equals()

Mike Klaas
Hi,

I had a filter type that was interacting poorly with the Solr
filterCache--identical filters were causing _2_ filterCache insertions
per query.

The field is for a url's domain name, and for some reason
WordDelimiterFilter was being uses with generateParts=catenateWords=1.

The filer query looked something like "domain:org.python.www", which
produced the following Query:

MultiPhraseQuery(domain:"org python (www orgpythonwww)")'

Now, there really is no need for the part catenation, so I turned it
off.  The parsed query is now:

PhraseQuery(domain:"org python www")'

and the filterCache is working as expected.

I'd suspect a bug in MultiPhraseQuery.equals(), but glancing at it, it
looks fine.

Ideas?

-Mike
Reply | Threaded
Open this post in threaded view
|

Re: MultiPhraseQuery and .equals()

Yonik Seeley-2
On 2/8/07, Mike Klaas <[hidden email]> wrote:
> I had a filter type that was interacting poorly with the Solr
> filterCache--identical filters were causing _2_ filterCache insertions
> per query.

That is strange.
What were the two parts of the code that added to the filterCache?

If you re-run the same solr query, is something else added to the filterCache?
If not, it suggests some change was made to the MultiPhraseQuery
during the single Solr query.  If so, it suggests a problem with
MultiPhraseQuery.

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: MultiPhraseQuery and .equals()

Mike Klaas
On 2/8/07, Yonik Seeley <[hidden email]> wrote:
> On 2/8/07, Mike Klaas <[hidden email]> wrote:
> > I had a filter type that was interacting poorly with the Solr
> > filterCache--identical filters were causing _2_ filterCache insertions
> > per query.
>
> That is strange.
> What were the two parts of the code that added to the filterCache?

I haven't been able to figure that out.

> If you re-run the same solr query, is something else added to the filterCache?
> If not, it suggests some change was made to the MultiPhraseQuery
> during the single Solr query.  If so, it suggests a problem with
> MultiPhraseQuery.

After a single keyword + MultiPhraseQuery query:

lookups : 2
hits : 0
hitratio : 0.00
inserts : 2
evictions : 0
size : 2

Re-running hte same query:

lookups : 4
hits : 0
hitratio : 0.00
inserts : 4
evictions : 0
size : 4

-MIke
Reply | Threaded
Open this post in threaded view
|

Re: MultiPhraseQuery and .equals()

Mike Klaas
On 2/8/07, Mike Klaas <[hidden email]> wrote:

> On 2/8/07, Yonik Seeley <[hidden email]> wrote:
> > On 2/8/07, Mike Klaas <[hidden email]> wrote:
> > > I had a filter type that was interacting poorly with the Solr
> > > filterCache--identical filters were causing _2_ filterCache insertions
> > > per query.
> >
> > That is strange.
> > What were the two parts of the code that added to the filterCache?
>
> I haven't been able to figure that out.

Update: I am a fool.  Solr's does get queried twice as a result of
that particular query with different result offsets (due to the
internal machinery of the system).

So it is "only" caching one copy of the filter per query.

INFO: put: +domain:"org python (www orgpythonwww)"(hashCode=-1944743566)
INFO: put: +domain:"org python (www orgpythonwww)"(hashCode=393535838)
INFO: put: +domain:"org python (www orgpythonwww)"(hashCode=-1974003462)
INFO: put: +domain:"org python (www orgpythonwww)"(hashCode=-606209495)
...


-Mike