C# 클래스 Lucene.Net.Search.Suggest.DocumentValueSourceDictionary

Dictionary with terms and optionally payload information taken from stored fields in a Lucene index. Similar to DocumentDictionary, except it obtains the weight of the terms in a document based on a ValueSource.

NOTE:
  • The term and (optionally) payload fields have to be stored
  • if the term or (optionally) payload fields supplied do not have a value for a document, then the document is rejected by the dictionary

In practice the ValueSource will likely be obtained using the lucene expression module. The following example shows how to create a ValueSource from a simple addition of two fields: Expression expression = JavascriptCompiler.compile("f1 + f2"); SimpleBindings bindings = new SimpleBindings(); bindings.add(new SortField("f1", SortField.Type.LONG)); bindings.add(new SortField("f2", SortField.Type.LONG)); ValueSource valueSource = expression.getValueSource(bindings);

상속: Lucene.Net.Search.Suggest.DocumentDictionary
파일 보기 프로젝트 열기: apache/lucenenet 1 사용 예제들

공개 메소드들

메소드 설명
DocumentValueSourceDictionary ( IndexReader reader, string field, ValueSource weightsValueSource ) : Lucene.Net.Documents

Creates a new dictionary with the contents of the fields named field for the terms and uses the weightsValueSource supplied to determine the score.

DocumentValueSourceDictionary ( IndexReader reader, string field, ValueSource weightsValueSource, string payload ) : Lucene.Net.Documents

Creates a new dictionary with the contents of the fields named field for the terms, payload for the corresponding payloads and uses the weightsValueSource supplied to determine the score.

DocumentValueSourceDictionary ( IndexReader reader, string field, ValueSource weightsValueSource, string payload, string contexts ) : Lucene.Net.Documents

Creates a new dictionary with the contents of the fields named field for the terms, payload for the corresponding payloads, contexts for the associated contexts and uses the weightsValueSource supplied to determine the score.

메소드 상세

DocumentValueSourceDictionary() 공개 메소드

Creates a new dictionary with the contents of the fields named field for the terms and uses the weightsValueSource supplied to determine the score.
public DocumentValueSourceDictionary ( IndexReader reader, string field, ValueSource weightsValueSource ) : Lucene.Net.Documents
reader Lucene.Net.Index.IndexReader
field string
weightsValueSource ValueSource
리턴 Lucene.Net.Documents

DocumentValueSourceDictionary() 공개 메소드

Creates a new dictionary with the contents of the fields named field for the terms, payload for the corresponding payloads and uses the weightsValueSource supplied to determine the score.
public DocumentValueSourceDictionary ( IndexReader reader, string field, ValueSource weightsValueSource, string payload ) : Lucene.Net.Documents
reader Lucene.Net.Index.IndexReader
field string
weightsValueSource ValueSource
payload string
리턴 Lucene.Net.Documents

DocumentValueSourceDictionary() 공개 메소드

Creates a new dictionary with the contents of the fields named field for the terms, payload for the corresponding payloads, contexts for the associated contexts and uses the weightsValueSource supplied to determine the score.
public DocumentValueSourceDictionary ( IndexReader reader, string field, ValueSource weightsValueSource, string payload, string contexts ) : Lucene.Net.Documents
reader Lucene.Net.Index.IndexReader
field string
weightsValueSource ValueSource
payload string
contexts string
리턴 Lucene.Net.Documents