|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.transaxtions.search.rankingalgorithm.RankingHits
public class RankingHits
Returns the matching hits. Made to be comptabile with the Lucene Hits syntax.
RankingQuery,
RankingScore,
Serialized Form| Field Summary | |
|---|---|
java.util.ArrayList<RankingScore> |
hits
|
| Constructor Summary | |
|---|---|
RankingHits()
|
|
| Method Summary | |
|---|---|
org.apache.lucene.document.Document |
doc(int i)
Return a Lucene Document. |
int |
docid(int i)
Return a Lucene document id. |
org.apache.lucene.document.Document |
getDoc(int i)
Return a Lucene document. |
java.util.ArrayList<RankingScore> |
getHits()
Returns an ArrayList of RankingScore objects. |
int |
getNumHits()
Returns the number of hits. |
RankingScore |
getRankingScore(int i)
Returns a RankingScore for the the document in the list |
int |
length()
Returns the number of hits. |
int |
relevant(int i)
Returns the percentage relevancy of a document. |
double |
score(int i)
Similar to the Lucene score, except the return value is a double. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.util.ArrayList<RankingScore> hits
| Constructor Detail |
|---|
public RankingHits()
| Method Detail |
|---|
public org.apache.lucene.document.Document getDoc(int i)
throws java.lang.Throwable
i - index value into the list
java.lang.Throwable
public org.apache.lucene.document.Document doc(int i)
throws java.lang.Throwable
Example:
RankingHits rh = rq.search(query, is);
System.out.println("num hits=" + rh.getNumHits() + "--no docs=" + is.maxDoc());
for (int i=0; i<rh.getNumHits() && i<10; i++) {
System.out.println("i=" + i + "--" + rh.score(i) + "--docid=" + rh.docid(i) + "--doc=" + rh.doc(i).get(title) );
}
i - index value into the list
java.lang.Throwablepublic java.util.ArrayList<RankingScore> getHits()
RankingScorepublic int docid(int i)
Example:
RankingHits rh = rq.search(query, is);
System.out.println("num hits=" + rh.getNumHits() + "--no docs=" + is.maxDoc());
for (int i=0; i<rh.getNumHits() && i<10; i++) {
System.out.println("i=" + i + "--" + rh.score(i) + "--docid=" + rh.docid(i) + "--doc=" + rh.doc(i).get(title) );
}
i - index value into the list of hits
getHits()public int length()
Example:
RankingHits rh = rq.search(query, is);
System.out.println("num hits=" + rh.getNumHits() + "--no docs=" + is.maxDoc());
for (int i=0; i<rh.getNumHits() && i<10; i++) {
System.out.println("i=" + i + "--" + rh.score(i) + "--docid=" + rh.docid(i) + "--doc=" + rh.doc(i).get(title) );
}
public int getNumHits()
Example:
RankingHits rh = rq.search(query, is);
System.out.println("num hits=" + rh.getNumHits() + "--no docs=" + is.maxDoc());
for (int i=0; i<rh.getNumHits() && i<10; i++) {
System.out.println("i=" + i + "--" + rh.score(i) + "--docid=" + rh.docid(i) + "--doc=" + rh.doc(i).get(title) );
}
public RankingScore getRankingScore(int i)
i - index value into the list of hits
getHits(),
RankingScorepublic int relevant(int i)
i - index value into the list of hits
getHits()public double score(int i)
Example:
RankingHits rh = rq.search(query, is);
System.out.println("num hits=" + rh.getNumHits() + "--no docs=" + is.maxDoc());
for (int i=0; i<rh.getNumHits() && i<10; i++) {
System.out.println("i=" + i + "--" + rh.score(i) + "--docid=" + rh.docid(i) + "--doc=" + rh.doc(i).get(title) );
}
i - index value into the list of hits @getHits
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||