aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/prelude/query/ONearItem.java
blob: f0f5989d20d7eb9c722a2d452fd33969c553a8f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.query;


/**
 * Ordered NearItem.
 * Matches as a near operator, but also demands that the operands have the
 * same order in the document as in the query.
 *
 * @author bratseth
 */
public class ONearItem extends NearItem {

    /** Creates a ordered NEAR item with limit 2 */
    public ONearItem() {
        setDistance(2);
    }

    /**
     * Creates a ordered near item which matches if there are at most <code>distance</code>
     * separation between the words, in the right direction.
     */
    public ONearItem(int distance) {
        super(distance);
    }

    @Override
    public ItemType getItemType() {
        return ItemType.ONEAR;
    }

    @Override
    public String getName() {
        return "ONEAR";
    }

}