public class SampleQueryRewriteTransformer extends Object implements QueryTransformer
The example use case is to allow users to search for an author name but have that query get mapped to a first name or last name search. This could be accomplished with include fields in the schema but this method requires no configuration or ingestion changes. In addition, the rewriter will join in all the books for each author as child documents based on authorid.
authors:mike
JOIN(AND(table:authors, OR(firstname:mike, lastname:mike)), INNER(table:books, on="authorid"))
Constructor and Description |
---|
SampleQueryRewriteTransformer() |
Modifier and Type | Method and Description |
---|---|
String |
getChildTableName() |
String |
getJoinKey() |
List<String> |
getOrFields() |
String |
getPrimaryTableName() |
List<QueryFeedback> |
processQuery(QueryRequest queryRequest)
Processes a query by modifying it in-place.
|
void |
setChildTableName(String childTableName) |
void |
setJoinKey(String joinKey) |
void |
setOrFields(List<String> orFields) |
void |
setPrimaryTableName(String primaryTableName) |
public List<QueryFeedback> processQuery(QueryRequest queryRequest) throws AttivioException
QueryTransformer
processQuery
in interface QueryTransformer
queryRequest
- the query requestAttivioException
public String getPrimaryTableName()
public void setPrimaryTableName(String primaryTableName)
public String getChildTableName()
public void setChildTableName(String childTableName)
public String getJoinKey()
public void setJoinKey(String joinKey)
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.