Search in sources :

Example 1 with DispatchForm

use of com.yahoo.search.query.textserialize.serializer.DispatchForm in project vespa by vespa-engine.

the class TermConverter method itemToForm.

@Override
public DispatchForm itemToForm(Item item, ItemIdMapper itemIdMapper) {
    TermItem termItem = (TermItem) item;
    DispatchForm form = new DispatchForm(termItem.getItemType().name());
    ItemInitializer.initializeForm(form, item, itemIdMapper);
    form.addChild(getValue(termItem));
    return form;
}
Also used : DispatchForm(com.yahoo.search.query.textserialize.serializer.DispatchForm) TermItem(com.yahoo.prelude.query.TermItem)

Example 2 with DispatchForm

use of com.yahoo.search.query.textserialize.serializer.DispatchForm in project vespa by vespa-engine.

the class NearConverter method itemToForm.

@Override
public DispatchForm itemToForm(Item item, ItemIdMapper itemIdMapper) {
    DispatchForm dispatchForm = super.itemToForm(item, itemIdMapper);
    NearItem nearItem = (NearItem) item;
    dispatchForm.setProperty(distanceProperty, nearItem.getDistance());
    return dispatchForm;
}
Also used : DispatchForm(com.yahoo.search.query.textserialize.serializer.DispatchForm) NearItem(com.yahoo.prelude.query.NearItem)

Example 3 with DispatchForm

use of com.yahoo.search.query.textserialize.serializer.DispatchForm in project vespa by vespa-engine.

the class CompositeConverter method itemToForm.

@Override
public DispatchForm itemToForm(Item item, ItemIdMapper itemIdMapper) {
    CompositeItem compositeItem = (CompositeItem) item;
    DispatchForm form = new DispatchForm(getFormName(item));
    for (ListIterator<Item> i = compositeItem.getItemIterator(); i.hasNext(); ) {
        form.addChild(i.next());
    }
    ItemInitializer.initializeForm(form, item, itemIdMapper);
    return form;
}
Also used : CompositeItem(com.yahoo.prelude.query.CompositeItem) Item(com.yahoo.prelude.query.Item) CompositeItem(com.yahoo.prelude.query.CompositeItem) DispatchForm(com.yahoo.search.query.textserialize.serializer.DispatchForm)

Aggregations

DispatchForm (com.yahoo.search.query.textserialize.serializer.DispatchForm)3 CompositeItem (com.yahoo.prelude.query.CompositeItem)1 Item (com.yahoo.prelude.query.Item)1 NearItem (com.yahoo.prelude.query.NearItem)1 TermItem (com.yahoo.prelude.query.TermItem)1