Package com.browseengine.bobo.sort

Examples of com.browseengine.bobo.sort.DocComparatorSource$FloatDocComparatorSource


    return filter;
  }

  @Override
  public DocComparatorSource getDocComparatorSource() {
    return new DocComparatorSource() {
     
      @Override
      public DocComparator getComparator(IndexReader reader, int docbase)
          throws IOException {
        final UIDFacetHandler uidFacetHandler = UIDFacetHandler.this;
View Full Code Here


    return getFieldValues(reader,id);
  }

  @Override
  public DocComparatorSource getDocComparatorSource() {
    return new DocComparatorSource(){

      @Override
      public DocComparator getComparator(IndexReader reader, int docbase)
      throws IOException {
        ArrayList<DocComparator> comparatorList = new ArrayList<DocComparator>(_fieldsSet.size());
View Full Code Here

    return getFieldValues(reader,id);
  }

  @Override
  public DocComparatorSource getDocComparatorSource() {
    return new DocComparatorSource(){

      @Override
      public DocComparator getComparator(IndexReader reader, int docbase)
      throws IOException {
        ArrayList<DocComparator> comparatorList = new ArrayList<DocComparator>(_fieldsSet.size());
View Full Code Here

    return getFieldValues(reader, id);
  }

  @Override
  public DocComparatorSource getDocComparatorSource() {
    return new DocComparatorSource() {

      @Override
      public DocComparator getComparator(AtomicReader reader, int docbase) throws IOException {
        ArrayList<DocComparator> comparatorList = new ArrayList<DocComparator>(_fieldsSet.size());
        for (FacetHandler<?> handler : _facetHandlers) {
View Full Code Here

    return filter;
  }

  @Override
  public DocComparatorSource getDocComparatorSource() {
    return new DocComparatorSource() {
     
      @Override
      public DocComparator getComparator(IndexReader reader, int docbase)
          throws IOException {
        final UIDFacetHandler uidFacetHandler = UIDFacetHandler.this;
View Full Code Here

    final int[] intArray = activityValues instanceof ActivityIntValues ? ((ActivityIntValues) activityValues).getFieldValues() : null;
    final float[] floatArray = activityValues instanceof ActivityFloatValues ? ((ActivityFloatValues) activityValues).getFieldValues() : null;
    final long[] longArray = activityValues instanceof ActivityLongValues ? ((ActivityLongValues) activityValues).getFieldValues() : null;
   
    if (intArray != null)
    return new DocComparatorSource() {
      @Override
      public DocComparator getComparator(IndexReader reader, int docbase)
          throws IOException {
        final int[] indexes = (int[]) ((BoboIndexReader) reader).getFacetData(_name);
        return new DocComparator() {
          @Override
          public Comparable<Integer> value(ScoreDoc doc) {          
              return indexes[doc.doc] != -1 ? intArray[indexes[doc.doc]] : 0;          
          }

          @Override
          public int compare(ScoreDoc doc1, ScoreDoc doc2) { 
            int val1 = indexes[doc1.doc] != -1 ? intArray[indexes[doc1.doc]] : 0;
            int val2 = indexes[doc2.doc] != -1 ? intArray[indexes[doc2.doc]] : 0;           
            return (val1<val2 ? -1 : (val1==val2 ? 0 : 1));
          }
        };
      }
    };
    if (longArray != null)
        return new DocComparatorSource() {
        @Override
        public DocComparator getComparator(IndexReader reader, int docbase)
            throws IOException {
          final int[] indexes = (int[]) ((BoboIndexReader) reader).getFacetData(_name);
          return new DocComparator() {
            @Override
            public Comparable<Long> value(ScoreDoc doc) {          
                return indexes[doc.doc] != -1 ? longArray[indexes[doc.doc]] : 0;          
            }

            @Override
            public int compare(ScoreDoc doc1, ScoreDoc doc2) { 
              long val1 = indexes[doc1.doc] != -1 ? longArray[indexes[doc1.doc]] : 0;
              long val2 = indexes[doc2.doc] != -1 ? longArray[indexes[doc2.doc]] : 0;           
              return (val1<val2 ? -1 : (val1==val2 ? 0 : 1));
            }
          };
        }
      };
    
      return new DocComparatorSource() {
      @Override
      public DocComparator getComparator(IndexReader reader, int docbase)
          throws IOException {
        final int[] indexes = (int[]) ((BoboIndexReader) reader).getFacetData(_name);
        return new DocComparator() {
View Full Code Here

    }
  }

  @Override
  public DocComparatorSource getDocComparatorSource() {
    DocComparatorSource docComparatorSource = SynchronizedActivityRangeFacetHandler.super.getDocComparatorSource();
    return new DocComparatorSource() {
      @Override
      public DocComparator getComparator(IndexReader reader, int docbase) throws IOException {
        final DocComparator comparator = SynchronizedActivityRangeFacetHandler.super.getDocComparatorSource()
            .getComparator(reader, docbase);
        return new DocComparator() {
View Full Code Here

    return getFieldValues(reader,id);
  }

  @Override
  public DocComparatorSource getDocComparatorSource() {
    return new DocComparatorSource(){

      @Override
      public DocComparator getComparator(IndexReader reader, int docbase)
      throws IOException {
        ArrayList<DocComparator> comparatorList = new ArrayList<DocComparator>(_fieldsSet.size());
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.sort.DocComparatorSource$FloatDocComparatorSource

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.