[
https://issues.apache.org/jira/browse/JENA-1381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16139967#comment-16139967
]
ASF GitHub Bot commented on JENA-1381:
--------------------------------------
Github user osma commented on a diff in the pull request:
https://github.com/apache/jena/pull/274#discussion_r134999319
--- Diff:
jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java ---
@@ -240,6 +240,36 @@ private QueryIterator concreteSubject(Binding binding,
Node s, Node score, Node
}
private ListMultimap<String,TextHit> query(Node property, String
queryString, String lang, int limit, ExecutionContext execCxt) {
+ String graphURI = chooseGraphURI(execCxt);
+
+ if ( graphURI == null ) {
+ Explain.explain(execCxt.getContext(), "Text query:
"+queryString) ;
+ if ( log.isDebugEnabled())
+ log.debug("Text query: {} ({})", queryString,limit) ;
+ } else {
+ Explain.explain(execCxt.getContext(), "Text query
<"+graphURI+">: "+queryString) ;
+ if ( log.isDebugEnabled())
+ log.debug("Text query: {} <{}> ({})", queryString,
graphURI, limit) ;
+ }
+
+ // Cache-key does not matter if lang or graphURI are null
+ String cacheKey = limit + " " + property + " " + queryString + " "
+ lang + " " + graphURI ;
--- End diff --
Thanks for pinging @afs. It's been a while since I looked at this code, but
I think that the fix is the correct one here. I'm not sure I understand the
comment "Cache-key does not matter if lang or graphURI are null" though -
what's that intended to mean?
> jena-text does not respect graph indexing in the text query cache
> -----------------------------------------------------------------
>
> Key: JENA-1381
> URL: https://issues.apache.org/jira/browse/JENA-1381
> Project: Apache Jena
> Issue Type: Bug
> Components: Text
> Affects Versions: Jena 3.4.0
> Reporter: Andy Seaborne
> Assignee: Andy Seaborne
> Attachments: TextIndexReport.java
>
>
> jena-text does not respect the graph setting when using the text query cache.
> In the example attached, the dataset has two graphs; the first result is
> used for the second text query. Depending on the order, either both text
> queries are zero or both one hit when the right answer is zero, once and one,
> once.
> Note also the "graph" feature of jena-text only works with quad based
> datasets (strictly, ones that use GraphView for their graphs). General
> dataset do not. This is hidden in the pattern where there is a test triple
> pattern that the literal is actually in the graph.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)