Package com.google.appengine.api.search

Examples of com.google.appengine.api.search.Index


    public void testNamespace() throws InterruptedException, ParseException {
        String ns = "ns-indextest";
        String indexName = "ns-index";
        int docCount = 5;
        NamespaceManager.set(ns);
        Index index = searchService.getIndex(IndexSpec.newBuilder()
                .setName(indexName)
                .build());
        delDocs(index);
        addDocs(index, docCount);
View Full Code Here


    @Test
    public void testPutDeleteDocs() throws InterruptedException {
        String indexName = "put-index";
        String docId = "testPutDocs";
        List<String> docIdList = new ArrayList<>();
        Index index = searchService.getIndex(IndexSpec.newBuilder()
            .setName(indexName)
            .build());

        Field field = Field.newBuilder().setName("subject").setText("put(Document.Builder)").build();
        Document.Builder docBuilder = Document.newBuilder()
            .setId(docId + "1")
            .addField(field);
        index.put(docBuilder);
        docIdList.add(docId + "1");

        field = Field.newBuilder().setName("subject").setText("put(Document)").build();
        Document document = Document.newBuilder()
            .setId(docId + "2")
            .addField(field).build();
        index.put(document);
        docIdList.add(docId + "1");

        GetIndexesRequest request = GetIndexesRequest.newBuilder()
            .setIndexNamePrefix(indexName)
            .build();
View Full Code Here

    @Test
    public void testPutDeleteAsyncDocsByString() throws InterruptedException {
        String indexName = "put-index";
        String docId = "testPutDocs";
        List<String> docIdList = new ArrayList<>();
        Index index = searchService.getIndex(IndexSpec.newBuilder()
                .setName(indexName)
                .build());

        Field field = Field.newBuilder().setName("subject").setText("put(Document.Builder)").build();
        Document.Builder docBuilder = Document.newBuilder()
                .setId(docId + "1")
                .addField(field);
        index.put(docBuilder);
        docIdList.add(docId + "1");

        field = Field.newBuilder().setName("subject").setText("put(Document)").build();
        Document document = Document.newBuilder()
                .setId(docId + "2")
                .addField(field).build();
        index.put(document);
        docIdList.add(docId + "1");

        GetIndexesRequest request = GetIndexesRequest.newBuilder()
                .setIndexNamePrefix(indexName)
                .build();
View Full Code Here

    @Test
    public void testPutDeleteAsyncDocsByIterable() throws InterruptedException {
        String indexName = "put-index";
        String docId = "testPutDocs";
        Index index = createIndex(indexName, docId);

        List<String> dList = new ArrayList<>();
        Results<ScoredDocument> found = searchDocs(index, "", 0);
        Iterator<ScoredDocument> it = found.iterator();
View Full Code Here

    @Test
    public void testPutGetRangeGetRequest() throws InterruptedException {
        String indexName = "put-index";
        String docId = "testPutDocs";
        Index index = createIndex(indexName, docId);

        GetIndexesRequest request = GetIndexesRequest.newBuilder()
                .setIndexNamePrefix(indexName)
                .build();
        GetResponse<Index> response = searchService.getIndexes(request);
View Full Code Here

    @Test
    public void testPutGetRangeBuilder() throws InterruptedException {
        String indexName = "put-index";
        String docId = "testPutDocs";
        Index index = createIndex(indexName, docId);

        GetIndexesRequest request = GetIndexesRequest.newBuilder()
                .setIndexNamePrefix(indexName)
                .build();
        GetResponse<Index> response = searchService.getIndexes(request);
View Full Code Here

    @Test
    public void testPutGetRangeAsyncGetResponse() throws InterruptedException, ExecutionException {
        String indexName = "put-index";
        String docId = "testPutDocs";
        Index index = createIndex(indexName, docId);

        GetIndexesRequest request = GetIndexesRequest.newBuilder()
                .setIndexNamePrefix(indexName)
                .build();
        GetResponse<Index> response = searchService.getIndexes(request);
View Full Code Here

    @Test
    public void testPutGetRangeAsyncBuilder() throws InterruptedException, ExecutionException {
        String indexName = "put-index";
        String docId = "testPutDocs";
        Index index = createIndex(indexName, docId);

        GetIndexesRequest request = GetIndexesRequest.newBuilder()
                .setIndexNamePrefix(indexName)
                .build();
        GetResponse<Index> response = searchService.getIndexes(request);
View Full Code Here

    @Test
    public void testPutAsyncBuilder() {
        String indexName = "put-index";
        String docId = "testPutDocs";

        Index index = searchService.getIndex(IndexSpec.newBuilder()
                .setName(indexName)
                .build());

        Field field = Field.newBuilder().setName("subject").setText("put(Document.Builder)").build();
        Document.Builder docBuilder = Document.newBuilder()
                .setId(docId + "1")
                .addField(field);

        index.putAsync(docBuilder);

        GetIndexesRequest request = GetIndexesRequest.newBuilder()
                .setIndexNamePrefix(indexName)
                .build();
        GetResponse<Index> response = searchService.getIndexes(request);
View Full Code Here

    @Test
    public void testPutAsyncDocument() {
        String indexName = "put-index";
        String docId = "testPutDocs";

        Index index = searchService.getIndex(IndexSpec.newBuilder()
                .setName(indexName)
                .build());

        Field field = Field.newBuilder().setName("subject").setText("put(Document)").build();
        Document document = Document.newBuilder()
                .setId(docId + "1")
                .addField(field).build();

        Future<PutResponse> resp = index.putAsync(document);

        while (!resp.isDone()) {
            if (resp.isCancelled()) {
                break;
            }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.search.Index

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.