[
https://issues.apache.org/jira/browse/LUCENE-1486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12734349#action_12734349
]
Mark Harwood commented on LUCENE-1486:
--------------------------------------
{quote}for test checkMatches("\"(jo* -john) smyth\"", "2");
would document 5 be returned or just doc 2 should be returned,
{quote}
I presume you mean smith not smyth here otherwise nothing would match? If so,
doc 5 should match and position is relevant (subject to slop factors).
{quote}
Question 2)
Should these 2 queries behave the same when we fix the problem
// checkMatches("\"john -percival\"", "1"); // not logic doesn't work
// checkMatches("\"john (-percival)\"", "1"); // not logic doesn't work
{quote}
I suppose there's an open question as to if the second example is legal (the
brackets are unnecessary)
{quote}
Question 3)
checkMatches("\"jo* smith\"~2", "1,2,3,5"); // position logic works.
doc 6 is also returned, so this feature does not seem to be working.
{quote}
That looks like a bug related to slop factor?
{quote}
Question 4)
The usage of AND and AND_NEXT_TO is confusing to me
the query
checkMatches("\"(jo* AND mary) smith\"", "1,2,5"); // boolean logic with
{quote}
ANDs are ignored and turned into ORs (see earlier comments) but maybe a query
parse error should be thrown to emphasise this.
> Wildcards, ORs etc inside Phrase queries
> ----------------------------------------
>
> Key: LUCENE-1486
> URL: https://issues.apache.org/jira/browse/LUCENE-1486
> Project: Lucene - Java
> Issue Type: Improvement
> Components: QueryParser
> Affects Versions: 2.4
> Reporter: Mark Harwood
> Assignee: Mark Harwood
> Priority: Minor
> Fix For: 2.9
>
> Attachments: ComplexPhraseQueryParser.java,
> junit_complex_phrase_qp_07_21_2009.patch,
> junit_complex_phrase_qp_07_22_2009.patch, LUCENE-1486.patch,
> LUCENE-1486.patch, LUCENE-1486.patch, LUCENE-1486.patch,
> TestComplexPhraseQuery.java
>
>
> An extension to the default QueryParser that overrides the parsing of
> PhraseQueries to allow more complex syntax e.g. wildcards in phrase queries.
> The implementation feels a little hacky - this is arguably better handled in
> QueryParser itself. This works as a proof of concept for much of the query
> parser syntax. Examples from the Junit test include:
> checkMatches("\"j* smyth~\"", "1,2"); //wildcards and fuzzies
> are OK in phrases
> checkMatches("\"(jo* -john) smith\"", "2"); // boolean logic
> works
> checkMatches("\"jo* smith\"~2", "1,2,3"); // position logic
> works.
>
> checkBadQuery("\"jo* id:1 smith\""); //mixing fields in a
> phrase is bad
> checkBadQuery("\"jo* \"smith\" \""); //phrases inside phrases
> is bad
> checkBadQuery("\"jo* [sma TO smZ]\" \""); //range queries
> inside phrases not supported
> Code plus Junit test to follow...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]