本文整理汇总了Java中org.galagosearch.core.retrieval.query.StructuredQuery类的典型用法代码示例。如果您正苦于以下问题:Java StructuredQuery类的具体用法?Java StructuredQuery怎么用?Java StructuredQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StructuredQuery类属于org.galagosearch.core.retrieval.query包,在下文中一共展示了StructuredQuery类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transformQuery
import org.galagosearch.core.retrieval.query.StructuredQuery; //导入依赖的package包/类
public Node transformQuery(Node queryTree) throws Exception {
List<Traversal> traversals = featureFactory.getTraversals(this);
for (Traversal traversal : traversals) {
queryTree = StructuredQuery.copy(traversal, queryTree);
}
return queryTree;
}
示例2: parseQuery
import org.galagosearch.core.retrieval.query.StructuredQuery; //导入依赖的package包/类
public static Node parseQuery(String query, Parameters parameters) {
String queryType = parameters.get("queryType", "complex");
if (queryType.equals("simple")) {
return SimpleQuery.parseTree(query);
}
return StructuredQuery.parse(query);
}
示例3: testTraversal
import org.galagosearch.core.retrieval.query.StructuredQuery; //导入依赖的package包/类
public void testTraversal() throws Exception {
StructuredIndex index = new StructuredIndex(indexPath.getAbsolutePath());
StructuredRetrieval retrieval = new StructuredRetrieval(index, new Parameters());
ImplicitFeatureCastTraversal traversal = new ImplicitFeatureCastTraversal(new Parameters(), retrieval);
Node tree = StructuredQuery.parse("#combine(cat dog.title)");
// Just a smoke test for now, verifies that no exceptions are thrown
//Node result = StructuredQuery.copy(traversal, tree);
}
示例4: testRealDecimals
import org.galagosearch.core.retrieval.query.StructuredQuery; //导入依赖的package包/类
public void testRealDecimals() throws Exception {
Node root = StructuredQuery.parse("#weight(1.5 dog 2.0 cat)");
assertEquals("#weight( #inside( #text:1() #field:5() ) #text:dog() #inside( #text:2() #field:0() ) #text:cat() )", root.toString());
WeightConversionTraversal traversal = new WeightConversionTraversal(null, null);
Node result = StructuredQuery.copy(traversal, root);
assertEquals("#combine( #scale:@/1.5/( #text:dog() ) #scale:@/2.0/( #text:cat() ) )", result.toString());
}
示例5: testRealIntegers
import org.galagosearch.core.retrieval.query.StructuredQuery; //导入依赖的package包/类
public void testRealIntegers() throws Exception {
Node root = StructuredQuery.parse("#weight(1 dog 2 cat)");
assertEquals("#weight( #text:1() #text:dog() #text:2() #text:cat() )", root.toString());
WeightConversionTraversal traversal = new WeightConversionTraversal(null, null);
Node result = StructuredQuery.copy(traversal, root);
assertEquals("#combine( #scale:1( #text:dog() ) #scale:2( #text:cat() ) )", result.toString());
}
示例6: testIndriPoundNRewrite
import org.galagosearch.core.retrieval.query.StructuredQuery; //导入依赖的package包/类
public void testIndriPoundNRewrite() throws Exception {
String query = "#3()";
Node result = StructuredQuery.parse(query);
Node transformed = StructuredQuery.copy(new IndriWindowCompatibilityTraversal(null, null), result);
assertEquals("#od:3()", transformed.toString());
}
示例7: testIndriOdNRewrite
import org.galagosearch.core.retrieval.query.StructuredQuery; //导入依赖的package包/类
public void testIndriOdNRewrite() throws Exception {
String query = "#od3()";
Node result = StructuredQuery.parse(query);
Node transformed = StructuredQuery.copy(new IndriWindowCompatibilityTraversal(null, null), result);
assertEquals("#od:3()", transformed.toString());
}
示例8: testIndriUwNRewrite
import org.galagosearch.core.retrieval.query.StructuredQuery; //导入依赖的package包/类
public void testIndriUwNRewrite() throws Exception {
String query = "#uw5()";
Node result = StructuredQuery.parse(query);
Node transformed = StructuredQuery.copy(new IndriWindowCompatibilityTraversal(null, null), result);
assertEquals("#uw:5()", transformed.toString());
}