QueryOptions options = QueryOptions.newBuilder().setOffset(0).setLimit(50); IndexSpec indexSpec = IndexSpec.newBuilder().setName("Beneficiaries").build(); Index index = SearchServiceFactory.getSearchService().getIndex(indexSpec); Results<ScoredDocument>results = index.search(query);
public boolean exists(byte[] sha1) throws Exception { return index.search(sha1) >= 0; }
Query query = Query.newBuilder().build("Display_Name" + "=" + searchText); Index userDocIndex = getUserDocIndex(); Results<ScoredDocument> matchingUsers = userDocIndex.search(query);
import java.util.HashMap; import java.util.Map; import com.flaptor.indextank.apiclient.Index; import com.flaptor.indextank.apiclient.IndexTankClient; import com.flaptor.indextank.apiclient.IndexTankClient.Query; import com.flaptor.indextank.apiclient.IndexTankClient.SearchResults; public class IndexTankExample { public static void main(String[] args) throws Exception { IndexTankClient client = new IndexTankClient("<PRIVATE URL>"); Index index = client.getIndex("test"); Map<String, String> fields = new HashMap<String, String>(); fields.put("text", "foo bar baz"); index.addDocument("1", fields); SearchResults results = index.search(Query.forString("bar")); for (Map<String, Object> document : results.results) { System.out.println("doc id: " + document.get("docid")); } } }
long offset = index.search(sha1.digest()); if (offset < 0) return null;
long search = index.search(sha1.digest()); if (search > 0) return sha1;