Package org.apache.lucene.search

Examples of org.apache.lucene.search.ScoreDocComparator


                                            String relPath)
            throws IOException {
        PathFactory factory = PathFactoryImpl.getInstance();
        Path p = factory.create(relPath);
        try {
            ScoreDocComparator simple = new SimpleScoreDocComparator(
                    reader, nsMappings.translatePath(p));
            if (p.getLength() == 1) {
                return simple;
            } else {
                return new CompoundScoreDocComparator(reader,
View Full Code Here


    // instead of loading the FieldCache instance into memory.

    final FieldCache.StringIndex index =
            FieldCache.DEFAULT.getStringIndex(reader, fieldname);
 
    return new ScoreDocComparator ()
    {
      public final int compare (final ScoreDoc d0, final ScoreDoc d1) {
        final int f0 = index.order[d0.doc];
        final int f1 = index.order[d1.doc];
View Full Code Here

                                            String relPath)
            throws IOException {
        PathFactory factory = PathFactoryImpl.getInstance();
        Path p = factory.create(relPath);
        try {
            ScoreDocComparator simple = new SimpleScoreDocComparator(
                    reader, nsMappings.translatePath(p));
            if (p.getLength() == 1) {
                return simple;
            } else {
                return new CompoundScoreDocComparator(reader,
View Full Code Here

                    FieldNames.createNamedValue(propertyName, ""),
                    SharedFieldSortComparator.this, createComparatorValues);
        }
        starts[readers.size()] = maxDoc;

        return new ScoreDocComparator() {

            public final int compare(final ScoreDoc i, final ScoreDoc j) {
                int idx1 = readerIndex(i.doc);
                int idx2 = readerIndex(j.doc);
View Full Code Here

                                            String relPath)
            throws IOException {
        PathFactory factory = PathFactoryImpl.getInstance();
        Path p = factory.create(relPath);
        try {
            ScoreDocComparator simple = new SimpleScoreDocComparator(
                    reader, nsMappings.translatePath(p));
            if (p.getLength() == 1) {
                return simple;
            } else {
                return new CompoundScoreDocComparator(reader,
View Full Code Here

                    Name innerProperty,
                    Name outerProperty) throws IOException {
        super(inner);
        this.reader = reader;
        this.outerLookup = scs.newComparator(reader, outerProperty.toString());
        ScoreDocComparator comparator = scs.newComparator(reader, innerProperty.toString());
        ScoreNode[] nodes;
        // create lookup map
        while ((nodes = inner.nextScoreNodes()) != null) {
            sDoc.doc = nodes[innerScoreNodeIndex].getDoc(reader);
            Comparable value = comparator.sortValue(sDoc);
            if (value != null) {
                innerScoreNodes.addScoreNodes(value, nodes);
            }
        }
    }
View Full Code Here

                = SharedFieldCache.INSTANCE.getStringIndex(reader, field,
                        FieldNames.createNamedValue(propertyName, ""),
                        SharedFieldSortComparator.this,
                        createComparatorValues);

        return new ScoreDocComparator() {
            public final int compare(final ScoreDoc i, final ScoreDoc j) {
                final int fi = index.order[i.doc];
                final int fj = index.order[j.doc];
                if (fi < fj) {
                    return -1;
View Full Code Here

                    FieldNames.createNamedValue(propertyName, ""),
                    SharedFieldSortComparator.this, createComparatorValues);
        }
        starts[readers.size()] = maxDoc;

        return new ScoreDocComparator() {

            public final int compare(final ScoreDoc i, final ScoreDoc j) {
                int idx1 = readerIndex(i.doc);
                int idx2 = readerIndex(j.doc);
View Full Code Here

                    FieldNames.createNamedValue(propertyName, ""),
                    SharedFieldSortComparator.this, createComparatorValues);
        }
        starts[readers.size()] = maxDoc;

        return new ScoreDocComparator() {

            public final int compare(final ScoreDoc i, final ScoreDoc j) {
                int idx1 = readerIndex(i.doc);
                int idx2 = readerIndex(j.doc);              
View Full Code Here

                  SharedFieldCache.INSTANCE.getStringIndex(r, field, FieldNames.createNamedValue(propertyName, ""),
                           SharedFieldSortComparator.this, createComparatorValues);
      }
      starts[readers.size()] = maxDoc;

      return new ScoreDocComparator()
      {

         public final int compare(final ScoreDoc i, final ScoreDoc j)
         {
            int idx1 = readerIndex(i.doc);
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.ScoreDocComparator

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.