Class SpanNearClauseFactory
SpanNearClauseFactory:
Operations:
- create for a field name and an indexreader.
- add a weighted Term - this should add a corresponding SpanTermQuery, or increase the weight of an existing one.
- add a weighted subquery SpanNearQuery
- create a clause for SpanNearQuery from the things added above.
For this, create an array of SpanQuery's from the added ones. The clause normally is a SpanOrQuery over the added subquery SpanNearQuery the SpanTermQuery's for the added Term's
When it is necessary to suppress double subqueries as much as possible: GetHashCode() and Equals() on unweighted SpanQuery are needed (possibly via GetTerms(), the terms are individually hashable). Idem SpanNearQuery: hash on the subqueries and the slop. Evt. merge SpanNearQuery's by adding the weights of the corresponding subqueries.
To be determined: Are SpanQuery weights handled correctly during search by Lucene? Should the resulting SpanOrQuery be sorted? Could other SpanQueries be added for use in this factory:
- SpanOrQuery: in principle yes, but it only has access to it's terms via getTerms(); are the corresponding weights available?
- SpanFirstQuery: treat similar to subquery SpanNearQuery. (ok?)
- SpanNotQuery: treat similar to subquery SpanNearQuery. (ok?)
Factory for SpanOrQuery
Inheritance
Inherited Members
Assembly: Lucene.Net.QueryParser.dll
Syntax
[Serializable]
public class SpanNearClauseFactory
Constructors
Name | Description |
---|---|
SpanNearClauseFactory(IndexReader, String, BasicQueryFactory) |
Properties
Name | Description |
---|---|
BasicQueryFactory | |
Count | |
FieldName | |
IndexReader |
Methods
Name | Description |
---|---|
AddSpanQuery(Query) | |
AddSpanQueryWeighted(SpanQuery, Single) | |
AddTermWeighted(Term, Single) | |
Clear() | |
MakeSpanClause() |