Hi,
Faceting is indeed the best way to do it.
Here is how it will look like in java:
SolrQuery query = new SolrQuery();
query.setQuery("id:" + docId);
query.setFacet(true);
query.addFacetField("text"); // You can add all fields you
want to inspect
query.setFacetMinCount(1); // Otherwise you'll get even
tokens that are not in your document
QueryResponse rsp = this.index.query(query);
// Now look at the results (for field "text")
FacetField facetField = rsp.getFacetField("text");
for (Count field : facetField.getValues()) {
System.out.println(field.getName());
}
Xavier.
Le 20/08/2015 22:20, Upayavira a écrit :
On Thu, Aug 20, 2015, at 04:34 PM, Jean-Pierre Lauris wrote:
Hi,
I'm trying to obtain indexed tokens from a document id, in order to see
what has been indexed exactly.
It seems that DocumentAnalysisRequestHandler does that, but I couldn't
figure out how to use it in java.
The doc says I must provide a contentstream but the available init()
method
only takes a NamedList as a parameter.
https://lucene.apache.org/solr/5_1_0/solr-core/org/apache/solr/handler/DocumentAnalysisRequestHandler.html
Could somebody provide me with a short example of how to get index
information from a document id?
If you are talking about what I think you are, then that is used by the
Admin UI to implement the analysis tab. You pass in a document, and it
returns it analysed.
As Alexandre says, faceting may well get you there if you want to query
a document already in your index.
Upayavira
--
Xavier Tannier
Associate Professor / Maître de conférence (HDR)
Univ. Paris-Sud
LIMSI-CNRS (bât. 508, bureau 12, RdC)
B.P. 133
91403 ORSAY CEDEX
FRANCE
http://www.limsi.fr/~xtannier/ <http://www.limsi.fr/%7Extannier/>
tel: 0033 (0)1 69 85 80 12
fax: 0033 (0)1 69 85 80 88
-----------------------------------------------------------