[ 
https://issues.apache.org/jira/browse/JENA-1381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16138798#comment-16138798
 ] 

ASF GitHub Bot commented on JENA-1381:
--------------------------------------

Github user afs commented on a diff in the pull request:

    https://github.com/apache/jena/pull/274#discussion_r134827626
  
    --- 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 --
    
    @osma If you have a moment, please could you check I haven't misunderstood 
the design here and that changing the cache-key will not cause other problems.


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

Reply via email to