lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Query Formalism for Texts with Program Code
Date Thu, 28 Oct 2010 23:35:33 GMT
typically one simply escapes the symbols that have special
meaning in your syntax. In your example,
hot\(dog\) would indicate to the parser that the () characters
were to be interpreted as text rather than part of the query language.

Lucene uses javaCC to parse queries following grammar rules....

HTH
Erick

On Thu, Oct 28, 2010 at 3:03 PM, Jan Burse <janburse@fastmail.fm> wrote:

> Dear All
>
> Was setting up a web search with a query language
> that uses (, !, ), ^, *, ?, {, } and < in its syntax.
> For example:
>
>  hot dog:     Looks for documents with hot and
>               dog in close vincinity.
>  (hot dog):   Looks for documents with hot or
>               dog in it.
>
> This all went fine as long as I was using it for
> natural language texts. But now I have also
> content in the form of program code. I now
> would like to do a search:
>
>   hot(dog):   Should look for documents with
>               an invocation of hot with argument
>               dog.
>
> How does lucene deal with this type of text?
>
> Bye
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message