Thanks for the advice Chris.  What I am working on now is extracting the
matching phrases.  The current code for MultiPhraseQuery and SpanQueries
just return all matching terms, not matching phrases.  I implemented some
code matching up the TermPositions, but this is pretty slow.  Is there any
way to actually get the matching phrases more efficiently?

On Fri, Feb 22, 2008 at 11:42 AM, Chris Hostetter <[EMAIL PROTECTED]>
wrote:

>
> : By custom phrase query class I was trying to ask if it would be
> possible, or
> : even a good idea, to create a modified PhraseQuery class that is more
> : efficient that span queries (as I only want to use it for phrases). This
> : class might have multiple possible terms generated from a regex at a
> certain
> : position.
>
> Ah! ... sorry, i missunderstood.  the answer to the questions are: yes it
> is possible and yes it is a good idea if you don't need the full power of
> Spans.
>
> The answerto the question you didn't ask is: yes such a thing exists ...
> take a look at MultiPhraseQuery.  :)
>
> QueryParser uses it when getFieldQuery returns multiple terms with a
> position gap of "0" ... which is perfect for things like synonys.
>
> you could have your own custom RegexPhraseQuery that can contain
> RegexQueries and TermQueries (instead of just Terms) and then rewrite to a
> MultiPhraseQuery once you rewrite the RegexQueries to a TermQueries.
>
> ...or something like that.
>
>
>
>
>
>
>
> :
> :
> : On Feb 15, 2008 5:47 PM, Chris Hostetter <[EMAIL PROTECTED]>
> wrote:
> :
> : >
> : > : I was wondering if anyone has a more efficient method for achieving
> : > this.
> : > : Would changing QueryParser.jj and developing a custom PhraseQuery
> class
> : > be a
> : > : good idea?  Any comments would be appreciated.
> : >
> : > extending QueryParser and overriding the getPhraseQuery function to
> return
> : > your own SpanNearQueries composted of SpanRegexQueries shouldn't be
> any
> : > more efficient then modifying the QueryParser grammer.  either way
> it's
> : > going to be calling some method you write that returns a
> SpanNearQuery.
> : >
> : >
> : >
> : > -Hoss
> : >
> : >
> : > ---------------------------------------------------------------------
> : > To unsubscribe, e-mail: [EMAIL PROTECTED]
> : > For additional commands, e-mail: [EMAIL PROTECTED]
> : >
> : >
> :
>
>
>
> -Hoss
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to