It looks like that I can't construct a QueryContext object with compound
query.
It gives me the following exception when I try to run it:

"org.apache.lucene.queryParser.ParseException: Cannot parse
'name:milena%20OR%20name:araujo': Encountered \" \":\" \": \"\" at line 1,
column 24.\nWas expecting one of:\n    <EOF> \n    <AND> ...\n    <OR> ...\n
   <NOT> ...\n    \"+\" ...\n    \"-\" ...\n    \"(\" ...\n    \"*\" ...\n
 \"^\" ...\n    <QUOTED> ...\n    <TERM> ...\n    <FUZZY_SLOP> ...\n
 <PREFIXTERM> ...\n    <WILDTERM> ...\n    \"[\" ...\n    \"{\" ...\n
 <NUMBER> ...\n    ",
  "exception" : "java.lang.RuntimeException:
org.apache.lucene.queryParser.ParseException: Cannot parse
'name:milena%20OR%20name:araujo': Encountered \" \":\" \": \"\" at line 1,
column 24.\nWas expecting one of:\n    <EOF> \n    <AND> ...\n    <OR> ...\n
   <NOT> ...\n    \"+\" ...\n    \"-\" ...\n    \"(\" ...\n    \"*\" ...\n
 \"^\" ...\n    <QUOTED> ...\n    <TERM> ...\n    <FUZZY_SLOP> ...\n
 <PREFIXTERM> ...\n    <WILDTERM> ...\n    \"[\" ...\n    \"{\" ...\n
 <NUMBER> ...\n    ",

The line that it breaks is the following:


IndexHits<Node> hits = index.query( new QueryContext( query ).sortByScore()
);


On Wed, Jun 22, 2011 at 10:22 PM, Mattias Persson <matt...@neotechnology.com
> wrote:

> That should be possibly, I can't think of any reason why not.
>
> 2011/6/22 Milena Araujo <mil...@illusorium.com>
>
> > Hello all !
> >
> > So, looking here:
> >
> >
> http://docs.neo4j.org/chunked/snapshot/indexing-lucene-extras.html#indexing-lucene-sort
> > There's an example of how to sort by score and later on, how to make a
> > compound query.
> > Is it possible to do both ?
> > Something like: hits = movies.query( new QueryContext("title:*Matrix* AND
> > year:1999" ).sortByScore() );
> >
> > Thanks,
> >
> > Milena Araujo.
> > _______________________________________________
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
>
>
>
> --
> Mattias Persson, [matt...@neotechnology.com]
> Hacker, Neo Technology
> www.neotechnology.com
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to