[Neo4j] LuceneSail queries returning empty result

Schmidt, Dennis dennis.schmidt at sap.com
Thu Dec 23 01:30:32 CET 2010


Thanks a lot Mattias, I added this to the LuceneSail code, recompiled it and now the Exception doesn't come up anymore.
Still, the result set is always empty. Even with the provided native example in the LuceneSail code itself and I have no clue what the reason might be since "normal" queries are working as expected.

Oh, and sry for "spamming" this mailing list. I accidently sent my initial message to the wrong list (this one). It was actually intended for the sesame mailing lsit...

Cheers,
Dennis


> Your exception is thrown because you've got a '*' as the first
> character of your query. By default the lucene query parser doesn't
> allow this, but you can override that by a call to
> QueryParser#setAllowLeadingWildcard(boolean). How you would do that in
> your setting I don't know, though.
>
> Den tisdag 21 december 2010 skrev Schmidt, Dennis<dennis.schmidt at sap.com>:
> > Hi all,
> >
> > I am currently using the LuceneSail on top of a DirectTypeHierarchyInferencer, ForwardChainingRDFSInferencer and a MemoryStore.
> > When using the following query, the LuceSail is obviously already working somehow, since the queries are roughly twice as fast as before. Still not > the real performance gain I was expecting from using Lucene (side note: the Strings are in fact only short text snippets of usually no more than 30 characters).
> > ----
> > SELECT entity, name, type
> > FROM {entity} rdfs:label {name} rdf:type {type}
> > WHERE name LIKE "*search this*" IGNORE CASE
> > ----
> > The LuceneSail homepage (http://dev.nepomuk.semanticdesktop.org/wiki/LuceneSail) introduces a different query format for using LuceneSail, so I was using this instead to see what happens. I changed the query to look like this then:
> > ----
> > PREFIX search:<http://www.openrdf.org/contrib/lucenesail#>
> > SELECT ?entity ?name ?type WHERE {
> > ?entity search:matches ?match ;
> >  ? ? ? ?rdf:type ?type .
> > ?match ?search:query "*search this*" . }
> > ----
> > I only changed from SERQL to SPARQL because SPARQL was used in the example as well. With this, the query is being executed correctly (meaning no Exceptions or anything) but then, there are never any ?results returned and the query execution is blazingly fast (which leads me to the conclusion it is in fact not executed as expected).
> >
> > So am I missing something there or what might be the reason? Another to me unexpected behaviour is that, when using a wildcard character at the beginning of a search string, I get the following error message. Why can I not use a wildcard at the beginning here? Doesn't make any sense to me.
> > ----
> > org.openrdf.sail.lucene.LuceneQueryIterator - There was a problem evaluating query '*search this*' for property 'null!
> > org.apache.lucene.queryParser.ParseException: Cannot parse '*search this*': '*' or '?' not allowed as first character in WildcardQuery
> > ----
> >
> > Thanks a lot in advance,
> > Dennis



More information about the User mailing list