Package io.crate.executor.transport.task.elasticsearch

Examples of io.crate.executor.transport.task.elasticsearch.SortOrder


            MultiValueMode sortMode = context.reverseFlag ? MultiValueMode.MAX : MultiValueMode.MIN;
            SearchContext searchContext = context.context.searchContext();

            FieldMapper fieldMapper = context.context.searchContext().smartNameFieldMapper(columnIdent.fqn());
            SortOrder sortOrder = new SortOrder(context.reverseFlag, context.nullFirst);
            IndexFieldData.XFieldComparatorSource fieldComparatorSource =
                    searchContext.fieldData().getForField(fieldMapper).comparatorSource(sortOrder.missing(), sortMode);

            return new SortField(
                    fieldMapper.names().indexName(),
                    fieldComparatorSource,
                    context.reverseFlag
View Full Code Here


            assert inputs.size() == 1;
            final Input functionInput = inputs.get(0);
            @SuppressWarnings("unchecked")
            final List<LuceneCollectorExpression> expressions = inputContext.docLevelExpressions();
            final SortField.Type type = luceneTypeMap.get(function.valueType());
            final SortOrder sortOrder = new SortOrder(context.reverseFlag, context.nullFirst);
            assert type != null : "Could not get lucene sort type for " + function.valueType();

            return new SortField(function.toString(), new IndexFieldData.XFieldComparatorSource() {
                @Override
                public FieldComparator<?> newComparator(String fieldName, int numHits, int sortPos, boolean reversed) throws IOException {
                    return new InputFieldComparator(
                            numHits,
                            context.context,
                            expressions,
                            functionInput,
                            function.valueType(),
                            missingObject(sortOrder.missing(), reversed)
                    );
                }

                @Override
                public SortField.Type reducedType() {
View Full Code Here

TOP

Related Classes of io.crate.executor.transport.task.elasticsearch.SortOrder

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.