lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Majid Laali <mjla...@gmail.com>
Subject How can I parse the TermVectorComponent response in SolrJ
Date Fri, 22 May 2015 21:49:51 GMT
Hi, 

I have a java program that sends a query to solr and get the term vector of a document. Something
like this:

SolrQuery solrQuery = new SolrQuery();
solrQuery.setRequestHandler("/tvrh");
solrQuery.setQuery("id:" + id);
solrQuery.setParam("fl", textField);
solrQuery.setParam("tv.tf", "true");
solrQuery.setParam("tv.df", "true");
solrQuery.setParam("tv.tf_idf", "true");
solrQuery.setRows(1);
QueryResponse docTVResponse = solrClient.query(solrQuery);
Object termVectors = docTVResponse.getResponse().get("termVectors”);

I am wondering if there is a class that can wrap the termVecotrs object so that I can access
to tf, idf of terms or I have to manually parse the json response of TermVectoreComponent.


Thanks in advance, 
Majid


/*******************************************
 *   Majid Laali, Ph.D. Candidate, 
 *   Computer Science & Software Engineering Department
 *   Concordia University
*******************************************/
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message