Search code examples
google-app-enginegoogle-search-api

Putting large number of documents: Google App Engine and Search API


It is question about limit on putting large number of documents in Search API. I intend to put 2057 documents(paragraphs from text file). When I parse each paragraph from text file, create document for each paragraph and put it into index, app seems to be running forever and not responding at all. What can be reason for such behavior?

With regards


Solution

  • I researched the documentation and found the following method:

    put(java.lang.Iterable<Document> documents)
    

    My way of importing like this:

    1. I collect all documents to be put into index in collector(ArrayList, List) until 200 documents(it's limit by GAE)
    2. Put this collector into this method
    

    In my case, it decreased the time of putting by 100 times