use of com.rbmhtechnology.vind.solr.backend.utils.Asset in project vind by RBMHTechnology.
the class SolrSearchServerTest method testExecute.
@Test
public void testExecute() throws Exception {
Asset asset = new Asset();
// FIXME: Asset has no @Id field
server.indexBean(asset);
// query
BeanSearchResult<Asset> result = server.execute(Search.fulltext("hello world").filter(eq("category", "test")), Asset.class);
// suggestion
SuggestionResult suggestions = server.execute(Search.suggest("he").fields("category"), Asset.class);
FieldDescriptor<String> title = new FieldDescriptorBuilder().setBoost(2).setLanguage(Language.German).buildTextField("title");
// complex
DocumentFactory factory = new DocumentFactoryBuilder("asset").addField(title).build();
Document document = factory.createDoc("1234");
server.index(document);
// suggestion
SuggestionResult suggestionsFromFactory = server.execute(Search.suggest("he").fields("title"), factory);
}
Aggregations