Hi All,
I try to understand how can I get phrase offsets as a result of search using
SOLRJ client.
I have only one field: <field name="contents" type="text_general"
indexed="true" stored="false" termVectors="true" termPositions="true"
termOffsets="true" />
I don't want to save the field content in the index.
I did it using LUCENE without SOLR.
FastVectorHighlighter fvh = new FastVectorHighlighter();
FieldQuery fq = fvh.getFieldQuery(query, reader);
FieldTermStack fts = new FieldTermStack(reader, docId,
FIELD_NAME, fq);
FieldPhraseList fpl = new FieldPhraseList(fts,fq);
List<FieldPhraseList.WeightedPhraseInfo> lwpi =
fpl.getPhraseList();
for (FieldPhraseList.WeightedPhraseInfo element : lwpi) {
System.out.println( "Start offset " +
element.getStartOffset() + " End offset " + element.getEndOffset() );
}
Is it possible to do it with SOLR 4.0 (SOLRJ)?
Thank in advance,
Vitaly