Search in sources :

Example 26 with SearchResult

use of com.rbmhtechnology.vind.api.result.SearchResult in project vind by RBMHTechnology.

the class TestServerTest method testDeleteByQuery.

/*
    @Test
    public void testZKConnection() {

        SearchConfiguration.set(SearchConfiguration.SERVER_SOLR_PROVIDER, "RemoteSolrServerProvider");
        SearchConfiguration.set(SearchConfiguration.SERVER_SOLR_CLOUD, true);
        SearchConfiguration.set(SearchConfiguration.SERVER_SOLR_HOST, "zkServerA:2181,zkServerB:2181,zkServerC:2181");
        SearchConfiguration.set(SearchConfiguration.SERVER_SOLR_COLLECTION, "my_collection");

        SearchServer server = SearchServer.getInstance();

        DocumentFactory assets = new DocumentFactoryBuilder("asset").build();
        SearchResult result = server.execute(Search.fulltext(), assets);

    }
    */
// MBDN-431
@Test
public void testDeleteByQuery() {
    ZonedDateTime now = ZonedDateTime.now(ZoneId.of("UTC"));
    ZonedDateTime yesterday = ZonedDateTime.now(ZoneId.of("UTC")).minus(1, ChronoUnit.DAYS);
    ZonedDateTime oneHourAgo = ZonedDateTime.now(ZoneId.of("UTC")).minus(1, ChronoUnit.HOURS);
    FieldDescriptor<String> title = new FieldDescriptorBuilder().setFullText(true).setFacet(true).buildTextField("title");
    SingleValueFieldDescriptor.DateFieldDescriptor<ZonedDateTime> created = new FieldDescriptorBuilder().setFacet(true).buildDateField("created");
    SingleValueFieldDescriptor.UtilDateFieldDescriptor<Date> modified = new FieldDescriptorBuilder().setFacet(true).buildUtilDateField("modified");
    NumericFieldDescriptor<Long> category = new FieldDescriptorBuilder().setFacet(true).buildMultivaluedNumericField("category", Long.class);
    DocumentFactory assets = new DocumentFactoryBuilder("asset").addField(title).addField(created).addField(category).addField(modified).build();
    Document d1 = assets.createDoc("1").setValue(title, "Hello World").setValue(created, yesterday).setValue(modified, new Date()).setValues(category, Arrays.asList(1L, 2L));
    Document d2 = assets.createDoc("2").setValue(title, "Hello Friends").setValue(created, now).setValue(modified, new Date()).addValue(category, 4L);
    SearchServer server = testSearchServer.getSearchServer();
    server.index(d1);
    server.index(d2);
    server.commit();
    FulltextSearch searchAll = Search.fulltext();
    final SearchResult searchResult = server.execute(searchAll, assets);
    assertEquals("No of results", 2, searchResult.getNumOfResults());
    final Document result = searchResult.getResults().get(0);
    assertThat("Doc-Title", result.getValue(title), Matchers.equalTo("Hello World"));
    Delete deleteBeforeOneHourAgo = new Delete(Filter.before("created", oneHourAgo));
    server.execute(deleteBeforeOneHourAgo, assets);
    server.commit();
    final SearchResult searchAfterDeleteResult = server.execute(searchAll, assets);
    assertEquals("No of results", 1, searchAfterDeleteResult.getNumOfResults());
    final Document nonDeletedResult = searchAfterDeleteResult.getResults().get(0);
    assertThat("Doc-Title", nonDeletedResult.getValue(title), Matchers.equalTo("Hello Friends"));
    Delete deleteByTitle = new Delete(Filter.eq(title, "Hello Friends"));
    server.execute(deleteByTitle, assets);
    server.commit();
    final SearchResult searchAfterTitleDeletionResult = server.execute(searchAll, assets);
    assertEquals("No of results", 0, searchAfterTitleDeletionResult.getNumOfResults());
}
Also used : Delete(com.rbmhtechnology.vind.api.query.delete.Delete) SearchServer(com.rbmhtechnology.vind.api.SearchServer) SearchResult(com.rbmhtechnology.vind.api.result.SearchResult) Document(com.rbmhtechnology.vind.api.Document) SolrInputDocument(org.apache.solr.common.SolrInputDocument) ZonedDateTime(java.time.ZonedDateTime) FulltextSearch(com.rbmhtechnology.vind.api.query.FulltextSearch) Test(org.junit.Test)

Example 27 with SearchResult

use of com.rbmhtechnology.vind.api.result.SearchResult in project vind by RBMHTechnology.

the class TestServerTest method prefixFilterTest.

// MBDN-461
@Test
public void prefixFilterTest() {
    final SingleValueFieldDescriptor.TextFieldDescriptor<String> textSingle = new FieldDescriptorBuilder().setFacet(true).buildTextField("textSingle");
    final MultiValueFieldDescriptor.TextFieldDescriptor<String> textMulti = new FieldDescriptorBuilder().setFacet(true).buildMultivaluedTextField("textMulti");
    final DocumentFactory assets = new DocumentFactoryBuilder("asset").addField(textSingle).addField(textMulti).build();
    final Document doc1 = assets.createDoc("1").setValue(textSingle, "text 1");
    final Document doc2 = assets.createDoc("2").setValue(textSingle, "Other text 2").setValues(textMulti, "text 2.1", "text 2.2");
    final SearchServer server = testSearchServer.getSearchServer();
    server.index(doc1);
    server.index(doc2);
    server.commit();
    FulltextSearch searchAll = Search.fulltext().filter(textSingle.prefix("tex"));
    SearchResult searchResult = server.execute(searchAll, assets).print();
    assertEquals("Just documents with single text fields starting with 'tex'", 1, searchResult.getNumOfResults());
    searchAll = Search.fulltext().filter(textMulti.prefix("tex"));
    searchResult = server.execute(searchAll, assets).print();
    assertEquals("Just documents with multi text fields starting with 'tex'", 1, searchResult.getNumOfResults());
}
Also used : SearchServer(com.rbmhtechnology.vind.api.SearchServer) SearchResult(com.rbmhtechnology.vind.api.result.SearchResult) MultiValueFieldDescriptor(com.rbmhtechnology.vind.model.MultiValueFieldDescriptor) Document(com.rbmhtechnology.vind.api.Document) SolrInputDocument(org.apache.solr.common.SolrInputDocument) FulltextSearch(com.rbmhtechnology.vind.api.query.FulltextSearch) Test(org.junit.Test)

Example 28 with SearchResult

use of com.rbmhtechnology.vind.api.result.SearchResult in project vind by RBMHTechnology.

the class TestServerTest method complexFieldTest.

// MBDN-455
@Test
public void complexFieldTest() {
    SingleValuedComplexField.NumericComplexField<Taxonomy, Integer, String> numericComplexField = new ComplexFieldDescriptorBuilder<Taxonomy, Integer, String>().setFacet(true, tx -> Arrays.asList(tx.getId())).setFullText(true, tx -> Arrays.asList(tx.getTerm())).setSuggest(true, tx -> Arrays.asList(tx.getLabel())).buildNumericComplexField("numberFacetTaxonomy", Taxonomy.class, Integer.class, String.class);
    SingleValuedComplexField.DateComplexField<Taxonomy, ZonedDateTime, String> dateComplexField = new ComplexFieldDescriptorBuilder<Taxonomy, ZonedDateTime, String>().setFacet(true, tx -> Arrays.asList(tx.getDate())).setFullText(true, tx -> Arrays.asList(tx.getTerm())).setSuggest(true, tx -> Arrays.asList(tx.getLabel())).buildDateComplexField("dateFacetTaxonomy", Taxonomy.class, ZonedDateTime.class, String.class);
    SingleValuedComplexField.TextComplexField<Taxonomy, String, String> textComplexField = new ComplexFieldDescriptorBuilder<Taxonomy, String, String>().setFacet(true, tx -> Arrays.asList(tx.getLabel())).setSuggest(true, tx -> Arrays.asList(tx.getLabel())).setStored(true, tx -> tx.getTerm()).buildTextComplexField("textFacetTaxonomy", Taxonomy.class, String.class, String.class);
    SingleValuedComplexField.DateComplexField<Taxonomy, ZonedDateTime, ZonedDateTime> dateStoredComplexField = new ComplexFieldDescriptorBuilder<Taxonomy, ZonedDateTime, ZonedDateTime>().setStored(true, tx -> tx.getDate()).buildSortableDateComplexField("dateStoredFacetTaxonomy", Taxonomy.class, ZonedDateTime.class, ZonedDateTime.class, cdf -> cdf.getDate());
    MultiValuedComplexField.TextComplexField<Taxonomy, String, String> multiComplexField = new ComplexFieldDescriptorBuilder<Taxonomy, String, String>().setFacet(true, tx -> Arrays.asList(tx.getLabel())).setSuggest(true, tx -> Arrays.asList(tx.getLabel())).setStored(true, tx -> tx.getTerm()).buildMultivaluedTextComplexField("multiTextTaxonomy", Taxonomy.class, String.class, String.class);
    FieldDescriptor<String> entityID = new FieldDescriptorBuilder().buildTextField("entityID");
    SingleValueFieldDescriptor<Date> dateField = new FieldDescriptorBuilder().buildUtilDateField("date");
    DocumentFactory assets = new DocumentFactoryBuilder("asset").addField(numericComplexField).addField(dateComplexField).addField(textComplexField).addField(dateField).addField(dateStoredComplexField).addField(entityID).addField(multiComplexField).build();
    Document d1 = assets.createDoc("1").setValue(numericComplexField, new Taxonomy("uno", 1, "Uno label", ZonedDateTime.now())).setValue(dateComplexField, new Taxonomy("uno", 1, "Uno label", ZonedDateTime.now())).setValue(textComplexField, new Taxonomy("uno", 1, "Label", ZonedDateTime.now())).setValue(entityID, "123").setValue(dateStoredComplexField, new Taxonomy("uno", 1, "Label", ZonedDateTime.now())).setValues(multiComplexField, new Taxonomy("uno", 1, "Label", ZonedDateTime.now()), new Taxonomy("dos", 2, "Label dos", ZonedDateTime.now())).setValue(dateField, new Date());
    Document d2 = assets.createDoc("2").setValue(numericComplexField, new Taxonomy("dos", 2, "dos label", ZonedDateTime.now())).setValue(dateComplexField, new Taxonomy("dos", 2, "dos label", ZonedDateTime.now())).setValue(textComplexField, new Taxonomy("uno", 2, "Label", ZonedDateTime.now())).setValue(entityID, "456").setValue(dateStoredComplexField, new Taxonomy("uno", 1, "Label", ZonedDateTime.now().plusMonths(1))).setValues(multiComplexField, new Taxonomy("uno", 1, "Label", ZonedDateTime.now()), new Taxonomy("dos", 1, "Label", ZonedDateTime.now())).setValue(dateField, new Date());
    SearchServer server = testSearchServer.getSearchServer();
    server.index(d1);
    server.index(d2);
    server.commit();
    FulltextSearch searchAll = Search.fulltext().filter(and(textComplexField.isNotEmpty(Scope.Facet), or(Filter.eq(numericComplexField, 1), Filter.eq(numericComplexField, 2)), numericComplexField.between(0, 5), dateComplexField.between(ZonedDateTime.now().minusDays(3), ZonedDateTime.now().plusDays(3)), textComplexField.equals("Label"))).facet(interval("facetNumber", numericComplexField, Interval.numericInterval("[1-4]", 0, 5), Interval.numericInterval("[6-9]", 5, 10))).facet(interval("facetDateInterval", dateComplexField, Interval.dateInterval("3_days_ago_till_now-1_hour]", ZonedDateTime.now().minusDays(3), ZonedDateTime.now().minusHours(1)), Interval.dateInterval("[now-1_hour_till_the_future]", ZonedDateTime.now().minusHours(1), null))).facet(range("facetRange", numericComplexField, 0, 10, 5)).facet(range("facetDateRange", dateComplexField, ZonedDateTime.now().minusDays(3), ZonedDateTime.now().plusDays(3), Duration.ofDays(1))).facet(stats("facetStats", numericComplexField)).facet(stats("facetDateStats", dateComplexField)).facet(stats("facetTextStats", textComplexField)).facet(pivot("facetPivot", numericComplexField, entityID, dateComplexField, textComplexField)).facet(numericComplexField, entityID, dateComplexField, textComplexField).sort(desc(dateStoredComplexField));
    final SearchResult searchResult = server.execute(searchAll, assets);
    assertEquals("Stored text exists", "uno", searchResult.getResults().get(0).getValue(textComplexField));
    assertThat("Multivalued text exists", (List<String>) searchResult.getResults().get(0).getValue(multiComplexField), containsInAnyOrder("uno", "dos"));
    assertEquals("No of interval", 2, searchResult.getFacetResults().getIntervalFacet("facetNumber").getValues().size());
    assertEquals("No of doc in interval", 2, searchResult.getFacetResults().getIntervalFacet("facetNumber").getValues().get(0).getCount());
    assertEquals("No of StatsFacets", 3, searchResult.getFacetResults().getStatsFacets().size());
    assertEquals("Stats Min: ", (Integer) 1, searchResult.getFacetResults().getStatsFacet("facetStats", Integer.class).getMin());
    assertEquals("Stats Max: ", (Integer) 2, searchResult.getFacetResults().getStatsFacet("facetStats", Integer.class).getMax());
    assertEquals("Stats Sum: ", (Integer) 3, searchResult.getFacetResults().getStatsFacet("facetStats", Integer.class).getSum());
    final SuggestionResult suggestSearch = server.execute(Search.suggest("la").fields(numericComplexField, textComplexField), assets);
    assertEquals(3, suggestSearch.size());
    assertEquals("Label", suggestSearch.get(textComplexField).getValues().get(0).getValue());
    assertEquals("Uno label", suggestSearch.get(numericComplexField).getValues().get(0).getValue());
}
Also used : Interval(com.rbmhtechnology.vind.api.query.facet.Interval) PageResult(com.rbmhtechnology.vind.api.result.PageResult) java.util(java.util) Delete(com.rbmhtechnology.vind.api.query.delete.Delete) Matchers.isA(org.hamcrest.Matchers.isA) ZonedDateTime(java.time.ZonedDateTime) Function(java.util.function.Function) ByteBuffer(java.nio.ByteBuffer) SolrServerException(org.apache.solr.client.solrj.SolrServerException) Sort.desc(com.rbmhtechnology.vind.api.query.sort.Sort.desc) FulltextSearch(com.rbmhtechnology.vind.api.query.FulltextSearch) FacetMapper(com.rbmhtechnology.vind.utils.mam.FacetMapper) Duration(java.time.Duration) NumericFieldDescriptor(com.rbmhtechnology.vind.model.MultiValueFieldDescriptor.NumericFieldDescriptor) DateMathExpression(com.rbmhtechnology.vind.api.query.datemath.DateMathExpression) ExpectedException(org.junit.rules.ExpectedException) SearchServer(com.rbmhtechnology.vind.api.SearchServer) Language(com.rbmhtechnology.vind.annotations.language.Language) TermFacetResult(com.rbmhtechnology.vind.api.result.facet.TermFacetResult) SearchConfiguration(com.rbmhtechnology.vind.configure.SearchConfiguration) Facets(com.rbmhtechnology.vind.api.query.facet.Facets) SearchResult(com.rbmhtechnology.vind.api.result.SearchResult) LatLng(com.rbmhtechnology.vind.model.value.LatLng) RangeFacetResult(com.rbmhtechnology.vind.api.result.facet.RangeFacetResult) QueryResponse(org.apache.solr.client.solrj.response.QueryResponse) MultiValueFieldDescriptor(com.rbmhtechnology.vind.model.MultiValueFieldDescriptor) Sort(com.rbmhtechnology.vind.api.query.sort.Sort) Matchers(org.hamcrest.Matchers) Test(org.junit.Test) IOException(java.io.IOException) GetResult(com.rbmhtechnology.vind.api.result.GetResult) com.rbmhtechnology.vind.model(com.rbmhtechnology.vind.model) ZoneId(java.time.ZoneId) Document(com.rbmhtechnology.vind.api.Document) SuggestionResult(com.rbmhtechnology.vind.api.result.SuggestionResult) SolrClient(org.apache.solr.client.solrj.SolrClient) TimeUnit(java.util.concurrent.TimeUnit) TimeUnit(com.rbmhtechnology.vind.api.query.datemath.DateMathExpression.TimeUnit) Search(com.rbmhtechnology.vind.api.query.Search) Rule(org.junit.Rule) ChronoUnit(java.time.temporal.ChronoUnit) Matchers.containsInAnyOrder(org.hamcrest.Matchers.containsInAnyOrder) SolrQuery(org.apache.solr.client.solrj.SolrQuery) Filter(com.rbmhtechnology.vind.api.query.filter.Filter) Assert(org.junit.Assert) Sort.asc(com.rbmhtechnology.vind.api.query.sort.Sort.asc) SolrInputDocument(org.apache.solr.common.SolrInputDocument) SearchServer(com.rbmhtechnology.vind.api.SearchServer) SearchResult(com.rbmhtechnology.vind.api.result.SearchResult) Document(com.rbmhtechnology.vind.api.Document) SolrInputDocument(org.apache.solr.common.SolrInputDocument) ZonedDateTime(java.time.ZonedDateTime) SuggestionResult(com.rbmhtechnology.vind.api.result.SuggestionResult) FulltextSearch(com.rbmhtechnology.vind.api.query.FulltextSearch) Test(org.junit.Test)

Example 29 with SearchResult

use of com.rbmhtechnology.vind.api.result.SearchResult in project vind by RBMHTechnology.

the class TestServerTest method advanceFilterTest.

// MDBN-486
@Test
public void advanceFilterTest() {
    SingleValuedComplexField.TextComplexField<Taxonomy, String, String> textComplexField = new ComplexFieldDescriptorBuilder<Taxonomy, String, String>().setFacet(true, tx -> Arrays.asList(tx.getLabel())).setAdvanceFilter(true, tx -> Arrays.asList(tx.getTerm())).buildTextComplexField("textFacetTaxonomy", Taxonomy.class, String.class, String.class);
    MultiValuedComplexField.TextComplexField<Taxonomy, String, String> multiComplexField = new ComplexFieldDescriptorBuilder<Taxonomy, String, String>().setFacet(true, tx -> Arrays.asList(tx.getLabel())).setStored(true, tx -> tx.getTerm()).setAdvanceFilter(true, tx -> Arrays.asList(tx.getTerm())).buildMultivaluedTextComplexField("multiTextTaxonomy", Taxonomy.class, String.class, String.class);
    DocumentFactory assets = new DocumentFactoryBuilder("asset").addField(textComplexField).addField(multiComplexField).build();
    Document d1 = assets.createDoc("1").setValue(textComplexField, new Taxonomy("uno", 1, "Label", ZonedDateTime.now())).setValues(multiComplexField, new Taxonomy("uno", 1, "Label", ZonedDateTime.now()), new Taxonomy("dos", 2, "Label dos", ZonedDateTime.now()));
    Document d2 = assets.createDoc("2").setValue(textComplexField, new Taxonomy("dos", 2, "Label", ZonedDateTime.now())).setValues(multiComplexField, new Taxonomy("dos . uno", 1, "Label", ZonedDateTime.now()), new Taxonomy("dos . dos", 1, "Label", ZonedDateTime.now()));
    SearchServer server = testSearchServer.getSearchServer();
    server.index(d1);
    server.index(d2);
    server.commit();
    SearchResult result = server.execute(Search.fulltext().filter(textComplexField.equals("uno", Scope.Filter)), assets);
    Assert.assertEquals(1, result.getNumOfResults());
    Assert.assertEquals("1", result.getResults().get(0).getId());
    result = server.execute(Search.fulltext().filter(multiComplexField.equals("uno", Scope.Filter)), assets);
    Assert.assertEquals(1, result.getNumOfResults());
    Assert.assertEquals("1", result.getResults().get(0).getId());
}
Also used : Interval(com.rbmhtechnology.vind.api.query.facet.Interval) PageResult(com.rbmhtechnology.vind.api.result.PageResult) java.util(java.util) Delete(com.rbmhtechnology.vind.api.query.delete.Delete) Matchers.isA(org.hamcrest.Matchers.isA) ZonedDateTime(java.time.ZonedDateTime) Function(java.util.function.Function) ByteBuffer(java.nio.ByteBuffer) SolrServerException(org.apache.solr.client.solrj.SolrServerException) Sort.desc(com.rbmhtechnology.vind.api.query.sort.Sort.desc) FulltextSearch(com.rbmhtechnology.vind.api.query.FulltextSearch) FacetMapper(com.rbmhtechnology.vind.utils.mam.FacetMapper) Duration(java.time.Duration) NumericFieldDescriptor(com.rbmhtechnology.vind.model.MultiValueFieldDescriptor.NumericFieldDescriptor) DateMathExpression(com.rbmhtechnology.vind.api.query.datemath.DateMathExpression) ExpectedException(org.junit.rules.ExpectedException) SearchServer(com.rbmhtechnology.vind.api.SearchServer) Language(com.rbmhtechnology.vind.annotations.language.Language) TermFacetResult(com.rbmhtechnology.vind.api.result.facet.TermFacetResult) SearchConfiguration(com.rbmhtechnology.vind.configure.SearchConfiguration) Facets(com.rbmhtechnology.vind.api.query.facet.Facets) SearchResult(com.rbmhtechnology.vind.api.result.SearchResult) LatLng(com.rbmhtechnology.vind.model.value.LatLng) RangeFacetResult(com.rbmhtechnology.vind.api.result.facet.RangeFacetResult) QueryResponse(org.apache.solr.client.solrj.response.QueryResponse) MultiValueFieldDescriptor(com.rbmhtechnology.vind.model.MultiValueFieldDescriptor) Sort(com.rbmhtechnology.vind.api.query.sort.Sort) Matchers(org.hamcrest.Matchers) Test(org.junit.Test) IOException(java.io.IOException) GetResult(com.rbmhtechnology.vind.api.result.GetResult) com.rbmhtechnology.vind.model(com.rbmhtechnology.vind.model) ZoneId(java.time.ZoneId) Document(com.rbmhtechnology.vind.api.Document) SuggestionResult(com.rbmhtechnology.vind.api.result.SuggestionResult) SolrClient(org.apache.solr.client.solrj.SolrClient) TimeUnit(java.util.concurrent.TimeUnit) TimeUnit(com.rbmhtechnology.vind.api.query.datemath.DateMathExpression.TimeUnit) Search(com.rbmhtechnology.vind.api.query.Search) Rule(org.junit.Rule) ChronoUnit(java.time.temporal.ChronoUnit) Matchers.containsInAnyOrder(org.hamcrest.Matchers.containsInAnyOrder) SolrQuery(org.apache.solr.client.solrj.SolrQuery) Filter(com.rbmhtechnology.vind.api.query.filter.Filter) Assert(org.junit.Assert) Sort.asc(com.rbmhtechnology.vind.api.query.sort.Sort.asc) SolrInputDocument(org.apache.solr.common.SolrInputDocument) SearchServer(com.rbmhtechnology.vind.api.SearchServer) SearchResult(com.rbmhtechnology.vind.api.result.SearchResult) Document(com.rbmhtechnology.vind.api.Document) SolrInputDocument(org.apache.solr.common.SolrInputDocument) Test(org.junit.Test)

Example 30 with SearchResult

use of com.rbmhtechnology.vind.api.result.SearchResult in project vind by RBMHTechnology.

the class TestServerTest method testPartialUpdate.

@Test
public void testPartialUpdate() {
    SearchServer server = testSearchServer.getSearchServer();
    SingleValueFieldDescriptor<String> title = new FieldDescriptorBuilder().setFullText(true).buildTextField("title");
    SingleValueFieldDescriptor.DateFieldDescriptor<ZonedDateTime> created = new FieldDescriptorBuilder().setFacet(true).buildDateField("created");
    NumericFieldDescriptor<Long> category = new FieldDescriptorBuilder().setFacet(true).buildMultivaluedNumericField("category", Long.class);
    SingleValueFieldDescriptor.NumericFieldDescriptor<Integer> count = new FieldDescriptorBuilder().setFacet(true).buildNumericField("count", Integer.class);
    DocumentFactory assets = new DocumentFactoryBuilder("asset").setUpdatable(true).addField(title, created, category, count).build();
    ZonedDateTime now = ZonedDateTime.now();
    Document d1 = assets.createDoc("123").setValue(title, "Hello World").setValue(count, 0).setValues(category, 1L, 2L, 3L).setValue(created, now);
    server.index(d1);
    server.commit();
    server.execute(Search.update("123").set(title, "123").add(category, 6L, 10L).remove(created, now).removeRegex(category, "10").increment(count, 1), assets);
    server.commit();
    SearchResult result = server.execute(Search.fulltext("123"), assets);
    assertEquals(1, result.getResults().size());
    assertEquals("123", result.getResults().get(0).getValue("_id_"));
    assertEquals("asset", result.getResults().get(0).getType());
    server.execute(Search.update("123").remove(category).increment(count, -1), assets);
    server.commit();
    SearchResult result2 = server.execute(Search.fulltext(), assets);
    assertEquals(1, result2.getResults().size());
}
Also used : SearchServer(com.rbmhtechnology.vind.api.SearchServer) SearchResult(com.rbmhtechnology.vind.api.result.SearchResult) Document(com.rbmhtechnology.vind.api.Document) SolrInputDocument(org.apache.solr.common.SolrInputDocument) ZonedDateTime(java.time.ZonedDateTime) Test(org.junit.Test)

Aggregations

SearchResult (com.rbmhtechnology.vind.api.result.SearchResult)38 Test (org.junit.Test)35 FulltextSearch (com.rbmhtechnology.vind.api.query.FulltextSearch)28 SearchServer (com.rbmhtechnology.vind.api.SearchServer)27 Document (com.rbmhtechnology.vind.api.Document)26 SolrInputDocument (org.apache.solr.common.SolrInputDocument)26 ZonedDateTime (java.time.ZonedDateTime)14 MultiValueFieldDescriptor (com.rbmhtechnology.vind.model.MultiValueFieldDescriptor)10 Interval (com.rbmhtechnology.vind.api.query.facet.Interval)9 DateMathExpression (com.rbmhtechnology.vind.api.query.datemath.DateMathExpression)8 Delete (com.rbmhtechnology.vind.api.query.delete.Delete)8 PageResult (com.rbmhtechnology.vind.api.result.PageResult)8 SuggestionResult (com.rbmhtechnology.vind.api.result.SuggestionResult)8 GetResult (com.rbmhtechnology.vind.api.result.GetResult)7 LatLng (com.rbmhtechnology.vind.model.value.LatLng)7 ByteBuffer (java.nio.ByteBuffer)7 Language (com.rbmhtechnology.vind.annotations.language.Language)6 Search (com.rbmhtechnology.vind.api.query.Search)6 TimeUnit (com.rbmhtechnology.vind.api.query.datemath.DateMathExpression.TimeUnit)6 Facets (com.rbmhtechnology.vind.api.query.facet.Facets)6