0

My local instance of Java Google App Engine seems to index search documents just fine, but started throwing an exception when running a search. Code snippet and exception included. TIA!

Code for searching :

QueryOptions options = QueryOptions.newBuilder()
            .setLimit(500)
            .build();
    String queryString = searchStr;
    Query query = Query.newBuilder().setOptions(options).build(queryString);

    IndexSpec indexSpec = IndexSpec.newBuilder().setName(projectName + "Search").build(); 
    Index index = SearchServiceFactory.getSearchService().getIndex(indexSpec);

    Results<ScoredDocument> results = null;

    try {

        results = index.search(query);

    } catch (SearchException e) {

    }

Exception:

java.lang.NullPointerException at com.google.appengine.repackaged.com.google.appengine.api.search.SearchServicePb$ListDocumentsResponse$Builder.addDocument(SearchServicePb.java:13298) at com.google.appengine.api.search.dev.LocalSearchService.listDocumentsForApp(LocalSearchService.java:527) at com.google.appengine.api.search.dev.LocalSearchService.getFieldTypes(LocalSearchService.java:710) at com.google.appengine.api.search.dev.LocalSearchService.searchForApp(LocalSearchService.java:564) at com.google.appengine.api.search.dev.LocalSearchService.search(LocalSearchService.java:547) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.callInternal(ApiProxyLocalImpl.java:525) at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:479) at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:456) at java.util.concurrent.Executors$PrivilegedCallable$1.run(Executors.java:493) at java.security.AccessController.doPrivileged(Native Method) at java.util.concurrent.Executors$PrivilegedCallable.call(Executors.java:490) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744)

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
  • This is not a question; it's a bug report. It would be better to file the bug report on the App Engine external issue tracker: https://code.google.com/p/googleappengine/wiki/FilingIssues?tm=3 We are not trying to be difficult. We actually tried to post a reply here, but it was removed by the Stack Exchange site guardians. – Alan May 31 '16 at 17:56
  • If it had been a while since you had indexed those documents, please remove the old indexed documents and index them again to see if that fixes it. There was a bug fix a while ago that could be related. Please let us know if reindexing solves the problem. – Dan McGrath Sep 22 '16 at 15:37

0 Answers0