no.sesat.search.query.finder
Class WhoWhereSplitter
java.lang.Object
no.sesat.commons.visitor.AbstractReflectionVisitor
no.sesat.search.query.finder.WhoWhereSplitter
- All Implemented Interfaces:
- no.sesat.commons.visitor.Visitor
public final class WhoWhereSplitter
- extends no.sesat.commons.visitor.AbstractReflectionVisitor
Essentially a QueryTransformer, the similarity is also evident in the context required.
But because it splits the one query into two it doesn't fit into the
command's query transformation chain, and is used by commands manually instead.
This class splits the query provided in the context into a who and where components.
These are returned as strings in the WhoWhereSplit class and the user is expected to parse each into separate
query objects if required.
The specifications of the split are complicated and were originally given by sesam.se's HittaSearchCommand.
If a query contains multiple fullnames and/or companynames then both who and where will be returned blank.
If just one fullname or companyname is found none of it's terms are moved to the where component.
Otherwise terms which match a geological tokenPredicate and do not match a name or phoneNumber tokenPredicate
are moved to the where component.
It is guaranteed that all terms in the original query can be found in either the who or where components except
the case when both components are blank.
The usefulness of this class is heavy dependant on the TokenPredicates:
FULLNAME, COMPANYNAME, COMPANY_KEYWORD, FIRSTNAME, LASTNAME, GEOGLOBAL, and GEOLOCAL;
being kept available and uptodate.
- Version:
- $Id: WhoWhereSplitter.java 7225 2009-04-09 00:32:20Z ssmiweve $
| Fields inherited from class no.sesat.commons.visitor.AbstractReflectionVisitor |
VISIT_METHOD_IMPL |
| Methods inherited from class no.sesat.commons.visitor.AbstractReflectionVisitor |
visit, visitImpl |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WhoWhereSplitter
public WhoWhereSplitter(WhoWhereSplitter.Context context)
- Creates a new instance of WhoWhereSplitter
- Parameters:
context -
getWhoWhereSplit
public WhoWhereSplitter.WhoWhereSplit getWhoWhereSplit()
- Returns:
visitImpl
protected void visitImpl(LeafClause clause)
- Parameters:
clause -
visitImpl
protected void visitImpl(UnaryClause clause)
- Parameters:
clause -
visitImpl
protected void visitImpl(BinaryClause clause)
- Parameters:
clause -
visitImpl
protected void visitImpl(NotClause clause)
- Parameters:
clause -
visitImpl
protected void visitImpl(AndNotClause clause)
- Parameters:
clause -
visitImpl
protected void visitImpl(XorClause clause)
- Parameters:
clause -
Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.