Example #1
0
    def run(self):

        #Create query retreiever object
        query_retriever = QueryRetriever(self.__capsule.user().getIndexLocation())
        query_retriever.getEnv().attachCurrentThread()

        #Return docs
        docs = query_retriever.search(self.__capsule.query())

        #let the cursor handler figure out when to return
        self.__capsule.cursor_handler().addRawDocuments(docs)
        query_retriever.finish()
Example #2
0
    def _checkState(self, arg) :
        self.__numItems += 1
        
        if self.__numItems >= (StateCapsule.QUERY_THRESHOLD*self.__THRESHOLD_MULTIPLIER) :

            query_retriever = QueryRetriever(self.__user.getIndexLocation())

            ##WARNING!!! WE SHOULD PROBABLY DO THIS IN ANOTHER THREAD (this is a mutex'ed section!)
            #kick off a query to check for more results
            docs = query_retriever.search(self.__query)
            self.__cursor_handler.addRawDocuments(docs)
            self.__numItems = 0
            self.__THRESHOLD_MULTIPLIER +=1
            query_retriever.finish()