Wolf Siberski wrote:
Doug Cutting wrote:

So, when a query is executed on a MultiSearcher of RemoteSearchables, the following remote calls are made:

1. RemoteSearchable.rewrite(Query) is called

After that step, are wildcards replaced by term lists?

Yes.

I haven't taken a look at the rewrite() methods. Could
you explain to me what is this step doing from a high-level
perspective. I'm not sufficiently familiar with Lucene yet.

Lucene has a few primitive query types: TermQuery, PhraseQuery, SpanQuery, and BooleanQuery. Other derived query types (RangeQuery, FuzzyQuery, WildcardQuery) are rewritten into primitive queries before evaluation. Rewriting typicially involves expanding the derived query into a BooleanQuery of TermQueries.


2. RemoteSearchable.docFreq(Term) is called for each term in the rewritten query while constructing a Weight.

We could optimize this step by sending a list of terms and receiving the corresponding list of docFreqs.

Yes. And this could entirely be hidden within the RemoteSearchable implementation. For example, the RPC made by its rewrite() implementation could also return the docFreq() of each term in the rewritten query, and these could be squirrelled away in a cache, which would then be accessed by the docFreq() method, so that only a single RPC is required to implement both rewrite() and all of the docFreq() calls.


Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to