Package org.apache.lucene.search.vectorhighlight.FieldQuery

Examples of org.apache.lucene.search.vectorhighlight.FieldQuery.QueryPhraseMap


    FieldQuery fq = new FieldQuery( query, true, true );
    Map<String, QueryPhraseMap> map = fq.rootMaps;
    assertEquals( 1, map.size() );
    assertNull( map.get( null ) );
    assertNotNull( map.get( F ) );
    QueryPhraseMap qpm = map.get( F );
    assertEquals( 2, qpm.subMap.size() );

    // "a b c"
    assertNotNull( qpm.subMap.get( "a" ) );
    QueryPhraseMap qpm2 = qpm.subMap.get( "a" );
    assertFalse( qpm2.terminal );
    assertEquals( 1, qpm2.subMap.size() );
    assertNotNull( qpm2.subMap.get( "b" ) );
    QueryPhraseMap qpm3 = qpm2.subMap.get( "b" );
    assertFalse( qpm3.terminal );
    assertEquals( 1, qpm3.subMap.size() );
    assertNotNull( qpm3.subMap.get( "c" ) );
    QueryPhraseMap qpm4 = qpm3.subMap.get( "c" );
    assertTrue( qpm4.terminal );
    assertEquals( 1F, qpm4.boost );
    assertNotNull( qpm4.subMap.get( "d" ) );
    QueryPhraseMap qpm5 = qpm4.subMap.get( "d" );
    assertTrue( qpm5.terminal );
    assertEquals( 1F, qpm5.boost );

    // "b c d"^2, "b d"^3
    assertNotNull( qpm.subMap.get( "b" ) );
View Full Code Here


    FieldQuery fq = new FieldQuery( query, true, true );
    Map<String, QueryPhraseMap> map = fq.rootMaps;
    assertEquals( 1, map.size() );
    assertNull( map.get( null ) );
    assertNotNull( map.get( F ) );
    QueryPhraseMap qpm = map.get( F );
    assertEquals( 1, qpm.subMap.size() );

    // "a b"
    assertNotNull( qpm.subMap.get( "a" ) );
    QueryPhraseMap qpm2 = qpm.subMap.get( "a" );
    assertFalse( qpm2.terminal );
    assertEquals( 1, qpm2.subMap.size() );
    assertNotNull( qpm2.subMap.get( "b" ) );
    QueryPhraseMap qpm3 = qpm2.subMap.get( "b" );
    assertTrue( qpm3.terminal );
    assertEquals( 1F, qpm3.boost );

    // "a b c"^2
    assertEquals( 1, qpm3.subMap.size() );
    assertNotNull( qpm3.subMap.get( "c" ) );
    QueryPhraseMap qpm4 = qpm3.subMap.get( "c" );
    assertTrue( qpm4.terminal );
    assertEquals( 2F, qpm4.boost );
  }
View Full Code Here

    FieldQuery fq = new FieldQuery( query, true, true );
    Map<String, QueryPhraseMap> map = fq.rootMaps;
    assertEquals( 1, map.size() );
    assertNull( map.get( null ) );
    assertNotNull( map.get( F ) );
    QueryPhraseMap qpm = map.get( F );
    assertEquals( 1, qpm.subMap.size() );

    // "a a a"
    assertNotNull( qpm.subMap.get( "a" ) );
    QueryPhraseMap qpm2 = qpm.subMap.get( "a" );
    assertFalse( qpm2.terminal );
    assertEquals( 1, qpm2.subMap.size() );
    assertNotNull( qpm2.subMap.get( "a" ) );
    QueryPhraseMap qpm3 = qpm2.subMap.get( "a" );
    assertFalse( qpm3.terminal );
    assertEquals( 1, qpm3.subMap.size() );
    assertNotNull( qpm3.subMap.get( "a" ) );
    QueryPhraseMap qpm4 = qpm3.subMap.get( "a" );
    assertTrue( qpm4.terminal );

    // "a a a a"
    assertEquals( 1, qpm4.subMap.size() );
    assertNotNull( qpm4.subMap.get( "a" ) );
    QueryPhraseMap qpm5 = qpm4.subMap.get( "a" );
    assertTrue( qpm5.terminal );

    // "a a a a a"
    assertEquals( 1, qpm5.subMap.size() );
    assertNotNull( qpm5.subMap.get( "a" ) );
    QueryPhraseMap qpm6 = qpm5.subMap.get( "a" );
    assertTrue( qpm6.terminal );

    // "a a a a a a"
    assertEquals( 1, qpm6.subMap.size() );
    assertNotNull( qpm6.subMap.get( "a" ) );
    QueryPhraseMap qpm7 = qpm6.subMap.get( "a" );
    assertTrue( qpm7.terminal );
  }
View Full Code Here

    FieldQuery fq = new FieldQuery( query, true, true );
    Map<String, QueryPhraseMap> map = fq.rootMaps;
    assertEquals( 1, map.size() );
    assertNull( map.get( null ) );
    assertNotNull( map.get( F ) );
    QueryPhraseMap qpm = map.get( F );
    assertEquals( 2, qpm.subMap.size() );

    // "ab bc"
    assertNotNull( qpm.subMap.get( "ab" ) );
    QueryPhraseMap qpm2 = qpm.subMap.get( "ab" );
    assertFalse( qpm2.terminal );
    assertEquals( 1, qpm2.subMap.size() );
    assertNotNull( qpm2.subMap.get( "bc" ) );
    QueryPhraseMap qpm3 = qpm2.subMap.get( "bc" );
    assertTrue( qpm3.terminal );
    assertEquals( 1F, qpm3.boost );

    // "ab bc cd"
    assertEquals( 1, qpm3.subMap.size() );
    assertNotNull( qpm3.subMap.get( "cd" ) );
    QueryPhraseMap qpm4 = qpm3.subMap.get( "cd" );
    assertTrue( qpm4.terminal );
    assertEquals( 1F, qpm4.boost );

    // "bc cd"
    assertNotNull( qpm.subMap.get( "bc" ) );
View Full Code Here

   */
  public FieldPhraseList( FieldTermStack fieldTermStack, FieldQuery fieldQuery ){
    final String field = fieldTermStack.getFieldName();

    LinkedList<TermInfo> phraseCandidate = new LinkedList<TermInfo>();
    QueryPhraseMap currMap = null;
    QueryPhraseMap nextMap = null;
    while( !fieldTermStack.isEmpty() ){
     
      phraseCandidate.clear();

      TermInfo ti = fieldTermStack.pop();
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.vectorhighlight.FieldQuery.QueryPhraseMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.