jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1613300 - in /jena/trunk/jena-text/src/main/java/org/apache/jena/query/text: TextIndex.java TextIndexLucene.java TextIndexSolr.java TextQueryPF.java
Date Thu, 24 Jul 2014 20:58:42 GMT
Author: andy
Date: Thu Jul 24 20:58:41 2014
New Revision: 1613300

URL: http://svn.apache.org/r1613300
Log:
Add markers for where changes are need for scoring

Modified:
    jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndex.java
    jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java
    jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexSolr.java
    jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java

Modified: jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndex.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndex.java?rev=1613300&r1=1613299&r2=1613300&view=diff
==============================================================================
--- jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndex.java (original)
+++ jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndex.java Thu Jul 24
20:58:41 2014
@@ -38,6 +38,9 @@ public interface TextIndex extends Close
     /** Get all entries for uri */
     public abstract Map<String, Node> get(String uri) ;
 
+    //** score
+    // Need to have more complex results.
+    
     /** Access the index - limit if -1 for as many as possible */ 
     public abstract List<Node> query(String qs, int limit) ;
     

Modified: jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java?rev=1613300&r1=1613299&r2=1613300&view=diff
==============================================================================
--- jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java (original)
+++ jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java Thu
Jul 24 20:58:41 2014
@@ -220,6 +220,7 @@ public class TextIndexLucene implements 
 
         // Align and DRY with Solr.
         for ( ScoreDoc sd : sDocs ) {
+            //** score :: sd.score
             Document doc = indexSearcher.doc(sd.doc) ;
             String[] x = doc.getValues(docDef.getEntityField()) ;
             if ( x.length != 1 ) {}
@@ -248,6 +249,7 @@ public class TextIndexLucene implements 
 
     @Override
     public List<Node> query(String qs, int limit) {
+        //** score
         try(IndexReader indexReader = DirectoryReader.open(directory)) {
             return query$(indexReader, qs, limit) ;
         } 

Modified: jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexSolr.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexSolr.java?rev=1613300&r1=1613299&r2=1613300&view=diff
==============================================================================
--- jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexSolr.java (original)
+++ jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexSolr.java Thu Jul
24 20:58:41 2014
@@ -174,6 +174,8 @@ public class TextIndexSolr implements Te
 
         for ( SolrDocument sd : solrResults )
         {
+            //** score
+            // 'score' field.
             String str = (String)sd.getFieldValue(docDef.getEntityField()) ;
             //log.info("Entity: "+uriStr) ;
             Node n = TextQueryFuncs.stringToNode(str) ;
@@ -189,6 +191,8 @@ public class TextIndexSolr implements Te
     private SolrDocumentList solrQuery(String qs, int limit)
     {
         SolrQuery sq = new SolrQuery(qs) ;
+        //** score
+        //sq.setIncludeScore(true) ;
         if ( limit > 0 )
             sq.setRows(limit) ;
         else 

Modified: jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java?rev=1613300&r1=1613299&r2=1613300&view=diff
==============================================================================
--- jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java (original)
+++ jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java Thu Jul
24 20:58:41 2014
@@ -49,6 +49,7 @@ public class TextQueryPF extends Propert
     private static Logger log           = LoggerFactory.getLogger(TextQueryPF.class) ;
     /*
      * ?uri :queryPF (property? "string" limit? score?) score? not implemented
+     * Look for "//** score" in TextIndexLucene and TextIndexSolr
      */
 
     private TextIndex     server        = null ;
@@ -59,7 +60,8 @@ public class TextQueryPF extends Propert
     @Override
     public void build(PropFuncArg argSubject, Node predicate, PropFuncArg argObject, ExecutionContext
execCxt) {
         super.build(argSubject, predicate, argObject, execCxt) ;
-
+        //** score
+        // Subject possibilities become ?foo or (?foo ?score) 
         DatasetGraph dsg = execCxt.getDataset() ;
         server = chooseTextIndex(dsg) ;
 



Mime
View raw message