lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Fruehwacht (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-373) Query parts ending with a colon are handled badly
Date Fri, 18 May 2012 06:45:02 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13278614#comment-13278614
] 

Jan Fruehwacht commented on LUCENE-373:
---------------------------------------

Do I understand it correct, that you say that it is bug when because there is also a space
before the xyz ? So it should be searched for ' xyz' under field ? Am I right ? Or how do
you expect that to work.
I totally understand the inconsistency described by Andrew.
                
> Query parts ending with a colon are handled badly
> -------------------------------------------------
>
>                 Key: LUCENE-373
>                 URL: https://issues.apache.org/jira/browse/LUCENE-373
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: core/queryparser
>    Affects Versions: 1.4
>         Environment: Operating System: Windows 2000
> Platform: PC
>            Reporter: Andrew Stevens
>            Priority: Minor
>              Labels: newdev
>
> I'm using Lucene 1.4.3, running
> Query query = QueryParser.parse(queryString, "contents", new StandardAnalyzer());
> If queryString is "search title:" i.e. specifying a field name without a
> corresponding value, I get a parsing exception:
> Encountered "<EOF>" at line 1, column 8.
> Was expecting one of:
>     "(" ...
>     <QUOTED> ...
>     <TERM> ...
>     <PREFIXTERM> ...
>     <WILDTERM> ...
>     "[" ...
>     "{" ...
>     <NUMBER> ...
> If queryString is "title: search", there's no exception.  However, the parsed
> query which is returned is "title:search".  If queryString is "title: contents:
> text", the parsed query is "title:contents" and the "text" part is ignored
> completely.  When queryString is "title: text contents:" the above exception is
> produced again.
> This seems inconsistent.  Given that it's pointless searching for an empty
> string (since it has no tokens), I'd expect both "search title:" & "title:
> search" to be parsed as "search" (or, given the default field I specified,
> "contents:search"), and "title: contents: text" & "title: text contents:" to
> parse as "text" ("contents:text") i.e. parts which have no term are ignored.  At
> worst I'd expect them all to throw a ParseException rather than just the ones
> with the colon at the end of the string.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message