示例#1
0
func NewIndexSearcherFromContext(context index.IndexReaderContext) *IndexSearcher {
	// assert2(context.isTopLevel, "IndexSearcher's ReaderContext must be topLevel for reader %v", context.reader())
	defaultSimilarity := NewDefaultSimilarity()
	ss := &IndexSearcher{nil, context.Reader(), context, context.Leaves(), defaultSimilarity}
	ss.spi = ss
	return ss
}
示例#2
0
func NewIndexSearcherFromContext(context index.IndexReaderContext) IndexSearcher {
	//assert context.isTopLevel: "IndexSearcher's ReaderContext must be topLevel for reader" + context.reader();
	defaultSimilarity := NewDefaultSimilarity()
	return IndexSearcher{context.Reader(), context, context.Leaves(), defaultSimilarity}
}