OyvindLGjesdal commented on issue #2094: URL: https://github.com/apache/jena/issues/2094#issuecomment-1835715730
> > ftext:red booze ftext:red booze ftext:red booze ftext:red booze note:red booze > > So that looks like a bug to me. > > The generated Lucene query is not properly quoting the search string when applying it to each field. Per https://lucene.apache.org/core/9_8_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Fields this means the query is only searching for `red` in the `ftext` field and `booze` in the default field, which does however happen to be `ftext` judging by the parsed query: > > > parsed query: +(ftext:red ftext:booze ftext:red ftext:booze ftext:red ftext:booze ftext:red ftext:booze note:red ftext:booze) +graph:urn:x-arq:DefaultGraphNode; limit: 10000 > > This means that only the first word in your query gets queried in the `note` field which is why the order of the terms in the query affects the results. > > @OyvindLGjesdal does that look like a valid analysis to you? > > It also looks like we generate duplicate query clauses when multiple properties map to the same Lucene field which might be unnecessary? @rvesse This looks like a valid analysis to me, but this is also unknown parts to me and based on reading the links you posted. But it does it does line up perfectly with the bug, and the solution looks good. I guess it would also just handle inner logic in inner parens. Thanks for the verbose output and experimenting @filak I can try to create a test for this during the weekend. This is probably only a bug in the propList, and not with the use of normal properties? I guess it would have been reported and noticed and caught by tests if this was also in `rdfs:label red booze`. On a second note, we should probably update the examples in the docs to remove the examples of setting a custom queryParser that no longer is present in Apache Lucene ` text:queryParser text:AnalyzingQueryParser ;` ``` 15:29:37 WARN TextIndexLucene :: Deprecated query parser type 'AnalyzingQueryParser'. Defaulting to standard QueryParser ``` When searching the web, the AnalyzingQueryParser is only present in lower versions of the javadocs. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
