当前位置: 首页>>代码示例>>Java>>正文


Java StructuredQuery类代码示例

本文整理汇总了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;
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:8,代码来源:StructuredRetrieval.java

示例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);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:10,代码来源:Search.java

示例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);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:9,代码来源:ImplicitFeatureCastTraversalTest.java

示例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());
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:9,代码来源:WeightConversionTraversalTest.java

示例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());
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:9,代码来源:WeightConversionTraversalTest.java

示例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());
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:7,代码来源:IndriWindowCompatibilityTraversalTest.java

示例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());
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:7,代码来源:IndriWindowCompatibilityTraversalTest.java

示例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());
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:7,代码来源:IndriWindowCompatibilityTraversalTest.java


注:本文中的org.galagosearch.core.retrieval.query.StructuredQuery类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。