Ejemplo n.º 1
0
 def NearNode(self, node):
     """ near search isn't working yet """
     word_nodes = []
     word_nodes = flatten_NearNode(node.getValue(), word_nodes)
     sets = [self(n) for n in word_nodes]
     rs = intersectionResultSets(sets) 
     raise NotImplementedError('Near search not implemented yet')
Ejemplo n.º 2
0
 def NearNode(self, node):
     """ near search isn't working yet """
     word_nodes = []
     word_nodes = flatten_NearNode(node.getValue(), word_nodes)
     sets = [self(n) for n in word_nodes]
     rs = intersectionResultSets(sets)
     raise NotImplementedError('Near search not implemented yet')
Ejemplo n.º 3
0
    def PhraseNode(self, node):
        # Dealing with PhraseNodes is somewhat tricks
        # node.getValue() should return a sequence of WordNodes representing
        # the terms of the phrase

        # first tcreate he a copy of the ordered(!) terms
        words = [n.getValue() for n in node.getValue()]

        # So first perform a simple word search for all terms
        sets = [self(n) for n in node.getValue()]

        # Now intersect the results (AND). This descreases the number of documents
        # to be checked.
        rs = intersectionResultSets(sets)

        # Now check if the found documents really contain the words as phrase
        return lookup_by_phrase(self.searchrequest, rs.getDocids(), words,
                                self._getField(node))
Ejemplo n.º 4
0
    def PhraseNode(self, node):
        # Dealing with PhraseNodes is somewhat tricks
        # node.getValue() should return a sequence of WordNodes representing
        # the terms of the phrase

        # first tcreate he a copy of the ordered(!) terms
        words = [n.getValue() for n in node.getValue()]

        # So first perform a simple word search for all terms
        sets = [self(n) for n in node.getValue()]

        # Now intersect the results (AND). This descreases the number of documents
        # to be checked.
        rs = intersectionResultSets(sets) 
        
        # Now check if the found documents really contain the words as phrase
        return lookup_by_phrase(self.searchrequest, 
                                rs.getDocids(), 
                                words,
                                self._getField(node))
Ejemplo n.º 5
0
 def AndNode(self, node):
     sets = [self(n) for n in node.getValue()]
     return intersectionResultSets(sets) 
Ejemplo n.º 6
0
 def AndNode(self, node):
     sets = [self(n) for n in node.getValue()]
     return intersectionResultSets(sets)