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 Mike Klaas <mi...@gmail.com> on 2007/02/08 22:08:49 UTC

MultiPhraseQuery and .equals()

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

Re: MultiPhraseQuery and .equals()

Posted by Mike Klaas <mi...@gmail.com>.
On 2/8/07, Mike Klaas <mi...@gmail.com> wrote:
> On 2/8/07, Yonik Seeley <yo...@apache.org> wrote:
> > On 2/8/07, Mike Klaas <mi...@gmail.com> 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

Re: MultiPhraseQuery and .equals()

Posted by Mike Klaas <mi...@gmail.com>.
On 2/8/07, Yonik Seeley <yo...@apache.org> wrote:
> On 2/8/07, Mike Klaas <mi...@gmail.com> 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

Re: MultiPhraseQuery and .equals()

Posted by Yonik Seeley <yo...@apache.org>.
On 2/8/07, Mike Klaas <mi...@gmail.com> 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