请问 先doc.setboost 再用doc.getboost得到的值为何不一样

illu 2010-01-22
首先创建索引时 每个document都setboost
然后进行查询 用IndexSearcher.doc来取出document
这时我用document.getboost得到的值还是1.0 和没设置一样
谁知道为什么? 谢谢了
illu 2010-01-22
补充下 query出的结果明显是按照boost进行排序的  但是为什么getboost 就是1.0呢? 
luckaway 2010-01-22
document里是没有存的,ScoreDoc里有的
索引和存储是分开的
public class ScoreDoc implements java.io.Serializable {
  /** Expert: The score of this document for the query. */
  public float score;

  /** Expert: A hit document's number.
   * @see Searcher#doc(int)
   */
  public int doc;

  /** Expert: Constructs a ScoreDoc. */
  public ScoreDoc(int doc, float score) {
    this.doc = doc;
    this.score = score;
  }
}

illu 2010-01-22
document里是没有存的,ScoreDoc里有的
索引和存储是分开的


那也就是说 我查询的时候是得不到创建索引的时候设置的boost咯?
luckaway 2010-01-22
ScoreDoc里有的
Global site tag (gtag.js) - Google Analytics