Search in sources :

Example 1 with JaccardSearchModifier

use of org.apache.hyracks.storage.am.lsm.invertedindex.search.JaccardSearchModifier in project asterixdb by apache.

the class AbstractInvertedIndexSearchTest method testNGramInvIndexIndex.

private void testNGramInvIndexIndex(LSMInvertedIndexTestContext testCtx) throws IOException {
    TupleGenerator tupleGen = LSMInvertedIndexTestUtils.createPersonNamesTupleGen(harness.getRandom());
    List<IInvertedIndexSearchModifier> searchModifiers = new ArrayList<>();
    searchModifiers.add(new ConjunctiveSearchModifier());
    searchModifiers.add(new JaccardSearchModifier(1.0f));
    searchModifiers.add(new JaccardSearchModifier(0.8f));
    searchModifiers.add(new JaccardSearchModifier(0.5f));
    searchModifiers.add(new EditDistanceSearchModifier(LSMInvertedIndexTestUtils.TEST_GRAM_LENGTH, 0));
    searchModifiers.add(new EditDistanceSearchModifier(LSMInvertedIndexTestUtils.TEST_GRAM_LENGTH, 1));
    searchModifiers.add(new EditDistanceSearchModifier(LSMInvertedIndexTestUtils.TEST_GRAM_LENGTH, 2));
    searchModifiers.add(new EditDistanceSearchModifier(LSMInvertedIndexTestUtils.TEST_GRAM_LENGTH, 3));
    runTest(testCtx, tupleGen, searchModifiers);
}
Also used : IInvertedIndexSearchModifier(org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexSearchModifier) JaccardSearchModifier(org.apache.hyracks.storage.am.lsm.invertedindex.search.JaccardSearchModifier) ArrayList(java.util.ArrayList) TupleGenerator(org.apache.hyracks.storage.am.common.datagen.TupleGenerator) EditDistanceSearchModifier(org.apache.hyracks.storage.am.lsm.invertedindex.search.EditDistanceSearchModifier) ConjunctiveSearchModifier(org.apache.hyracks.storage.am.lsm.invertedindex.search.ConjunctiveSearchModifier)

Example 2 with JaccardSearchModifier

use of org.apache.hyracks.storage.am.lsm.invertedindex.search.JaccardSearchModifier in project asterixdb by apache.

the class AbstractInvertedIndexSearchTest method testWordInvIndexIndex.

private void testWordInvIndexIndex(LSMInvertedIndexTestContext testCtx) throws IOException {
    TupleGenerator tupleGen = LSMInvertedIndexTestUtils.createStringDocumentTupleGen(harness.getRandom());
    List<IInvertedIndexSearchModifier> searchModifiers = new ArrayList<>();
    searchModifiers.add(new ConjunctiveSearchModifier());
    searchModifiers.add(new JaccardSearchModifier(1.0f));
    searchModifiers.add(new JaccardSearchModifier(0.8f));
    searchModifiers.add(new JaccardSearchModifier(0.5f));
    runTest(testCtx, tupleGen, searchModifiers);
}
Also used : IInvertedIndexSearchModifier(org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexSearchModifier) JaccardSearchModifier(org.apache.hyracks.storage.am.lsm.invertedindex.search.JaccardSearchModifier) ArrayList(java.util.ArrayList) TupleGenerator(org.apache.hyracks.storage.am.common.datagen.TupleGenerator) ConjunctiveSearchModifier(org.apache.hyracks.storage.am.lsm.invertedindex.search.ConjunctiveSearchModifier)

Aggregations

ArrayList (java.util.ArrayList)2 TupleGenerator (org.apache.hyracks.storage.am.common.datagen.TupleGenerator)2 IInvertedIndexSearchModifier (org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexSearchModifier)2 ConjunctiveSearchModifier (org.apache.hyracks.storage.am.lsm.invertedindex.search.ConjunctiveSearchModifier)2 JaccardSearchModifier (org.apache.hyracks.storage.am.lsm.invertedindex.search.JaccardSearchModifier)2 EditDistanceSearchModifier (org.apache.hyracks.storage.am.lsm.invertedindex.search.EditDistanceSearchModifier)1