English 中文(简体)
SIREn N-Tuples 结果
原标题:SIREn N-Tuples Results

在 SIREN 中, 是否可以使用 SolrDocument 中的 N- Tuples 值( 按名称) 工作? 我想在不对响应字符串进行正则表达的情况下分析查询结果 。

类似 :

SolrDocument.getField("ntriple","name"); // get "Jim Maple" value for  <http:/example.org/schema/name> predicate

更多详情:

//N-Tuple from the IndexQueryNTriple.java file

 private final String[] doc1 = 

 { "http:/example.org/person/jim",

 "<http:/example.org/person/jim> <http:/example.org/schema/type> <http:/example.org
  /schema/Person> .
" + 

  "<http:/example.org/person/jim> <http:/example.org/schema/name> "Jim Maple" .
" 
 };

 final SolrInputDocument document1 = new SolrInputDocument();

document1.addField("url", doc1[0]);
document1.addField("ntriple", doc1[1]);
add(document1); 

final SolrQuery query2 = new SolrQuery();
query2.setQueryType("siren");
query2.set(SirenParams.NQ, "* <name>  john AND gartner "); // ntriple query
final QueryResponse response2 = server.query(query2);
for (SolrDocument d : response2.getResults()) {

///?????? want to get  name  value from the long N-Triple string with ALL values
 d.getField("ntriple","name"); // get "Jim Maple" value

}
最佳回答

不幸的是,NxParser对它可以分析的三重格式有一些限制

问题回答

我找到了NxParser图书馆 来分析需要的N-Tuples。





相关问题
solr problem to get the field names

Ive got a problem. In each document I ve got fields: threads.id and posts.id. I want to get the field name value for them so i can get data from the database. Between the lines beneath i have marked ...

Which is the better client for Solr + PHP?

I have two options http://www.php.net/manual/en/book.solr.php http://code.google.com/p/solr-php-client/ I read it somewhere that that 2) use JSON as output types whereas 1) use XML doc. Isn t ...

Geronimo vs Glassfish

For a production environment, is Apache Geronimo better for applications that uses ActiveMQ, Derby, Solr?

Sort by date in Solr/Lucene performance problems

We have set up an Solr index containing 36 million documents (~1K-2K each) and we try to query a maximum of 100 documents matching a single simple keyword. This works pretty fast as we had hoped for. ...

SOLR - delta import not with last_modified

I saw only ways using delta import with last_modified. Is there some other ways to do delta_imports withut using timestamps? For example, if i have unique key(integer), can i tell SOLR to index only ...

SOLR How to return only limited matched content

ok guys, say in my Schema I have 4 fields: <field name="SiteIdentifier" type="string" indexed="true" stored="true" required="true"/> <field name="Title" type="text" indexed="true" stored="...

Solr - character substitution

I have Solr with indexed database. In my database all data is in Latvian. The problem is, I need to be able to search word Riga as if it is word Rīga. Of course, i can define synonym - Rīga = Riga, ...

热门标签