OyvindLGjesdal commented on issue #2094:
URL: https://github.com/apache/jena/issues/2094#issuecomment-1837613920

   I think I can confirm your analysis @rvesse 
   
   If I change default field to `  "    text:defaultField     \"comment\" ` 
   
   the verbose output expression falls back to using `comment`(default field), 
for `booze` and only the first word `red`.
    
   +(ftext:red comment:booze ftext:red comment:booze ftext:red comment:booze 
ftext:red comment:booze note:red comment:booze)
   
   @filak a workaround fo could be to put () around the text query `red booze`, 
I seem to get the expected result from the query, using that.
   ```
    "SELECT ?s",
                   "WHERE {",
                   "  ?s text:query ( mt:includeNotes \"(red booze)\" ) . ",
                   "}"
   ```
   
   This is the output 
   ```
   22:14:28 DEBUG TextIndexLucene :: query$ with LIST: 
[http://www.w3.org/2000/01/rdf-schema#label, 
http://id.example.test/vocab/#altLabel, 
http://id.example.test/vocab/#alt_label, http://id.example.test/mx/#alt_label, 
http://id.example.test/vocab/#note]; INPUT qString: (ftext:(red booze) 
ftext:(red booze) ftext:(red booze) ftext:(red booze) note:(red booze) ) AND 
graph:urn\:x\-arq\:DefaultGraphNode; with queryParserType: 
AnalyzingQueryParser; parseQuery with 
PerFieldAnalyzerWrapper({lang=org.apache.lucene.analysis.core.KeywordAnalyzer@59532566,
 uri=org.apache.lucene.analysis.core.KeywordAnalyzer@dca2615, 
graph=org.apache.lucene.analysis.core.KeywordAnalyzer@421a4ee1}, 
default=MultilingualAnalyzer(default=org.apache.jena.query.text.analyzer.ConfigurableAnalyzer@4f63e3c7))
 YIELDS: +((ftext:red ftext:booze) (ftext:red ftext:booze) (ftext:red 
ftext:booze) (ftext:red ftext:booze) (note:red note:booze)) 
+graph:urn:x-arq:DefaultGraphNode; parsed query: +((ftext:red ftext:booze) 
(ftext:red 
 ftext:booze) (ftext:red ftext:booze) (ftext:red ftext:booze) (note:red 
note:booze)) +graph:urn:x-arq:DefaultGraphNode; limit: 10000
   22:14:28 TRACE TextIndexLucene :: simpleResults[10]: fields: [ftext, ftext, 
ftext, ftext, note] doc: 
Document<stored,indexed,tokenized,indexOptions=DOCS<uri:http://id.example.test/2>
 stored,indexed,tokenized,indexOptions=DOCS<graph:urn:x-arq:DefaultGraphNode> 
stored,indexed,tokenized<note:Red or white> 
stored,indexed,tokenized,omitNorms,indexOptions=DOCS<lang:en> 
stored,indexed,tokenized,omitNorms,indexOptions=DOCS<uid:48bc17f6921b4efff3f082a027a3e2c11037e9262ab743ed174587619543f767>>
   22:14:28 TRACE TextIndexLucene :: simpleResults[3]: fields: [ftext, ftext, 
ftext, ftext, note] doc: 
Document<stored,indexed,tokenized,indexOptions=DOCS<uri:http://id.example.test/1>
 stored,indexed,tokenized,indexOptions=DOCS<graph:urn:x-arq:DefaultGraphNode> 
stored,indexed,tokenized<note:Booze is a pleasure> 
stored,indexed,tokenized,omitNorms,indexOptions=DOCS<lang:en> 
stored,indexed,tokenized,omitNorms,indexOptions=DOCS<uid:8df507c91a27f4bb554f97c7b5c6b980c48012ab2e23132a879189bbce05fc18>>
   22:14:28 TRACE TextQueryPF :: resultsToQueryIterator CALLED with results: 
[TextHit{node=http://id.example.test/2 literal="Red or white"@en 
score=0.58286893 graph=urn:x-arq:DefaultGraphNode 
prop=http://id.example.test/vocab/#note}, TextHit{node=http://id.example.test/1 
literal="Booze is a pleasure"@en score=0.51788014 
graph=urn:x-arq:DefaultGraphNode prop=http://id.example.test/vocab/#note}]
   ```
   
   However this looks like a bug, the intent seems clear that the propList is 
applied to the entire quoted expression and not the just the first word, also 
from the examples in the docs.
   
   Same bug happens  when using a single property:
   
   ```
   SELECT ?s",
                   "WHERE {",
                   "  ?s text:query ( mt:note \"booze red\" ) . ",
                   "}"
   
   ```
   ```
   INPUT qString: (note:booze red ) AND graph:urn\:x\-arq\:DefaultGraphNode; 
with queryParserType: AnalyzingQueryParser; parseQuery with 
PerFieldAnalyzerWrapper({lang=org.apache.lucene.analysis.core.KeywordAnalyzer@59532566,
 uri=org.apache.lucene.analysis.core.KeywordAnalyzer@dca2615, 
graph=org.apache.lucene.analysis.core.KeywordAnalyzer@421a4ee1}, 
default=MultilingualAnalyzer(default=org.apache.jena.query.text.analyzer.ConfigurableAnalyzer@4f63e3c7))
 YIELDS: +(note:booze comment:red) +graph:urn:x-arq:DefaultGraphNode; parsed 
query: +(note:booze comment:red) +graph:urn:x-arq:DefaultGraphNode; limit: 10000
   ```
   
   and just one hit:
   ```
    [TextHit{node=http://id.example.test/1 literal="Booze is a pleasure"@en 
score=0.51788014 graph=urn:x-arq:DefaultGraphNode 
prop=http://id.example.test/vocab/#note}]
   ```
   
   The bug remains also if the assembler config is minimized and just use all 
text default configs.


-- 
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]

Reply via email to