Skip to content
Snippets Groups Projects
  1. Nov 15, 2007
  2. Oct 23, 2007
  3. Sep 07, 2007
    • Teodor Sigaev's avatar
      Improvements from Heikki Linnakangas <heikki@enterprisedb.com> · 978de9d0
      Teodor Sigaev authored
      - change the alignment requirement of lexemes in TSVector slightly.
      Lexeme strings were always padded to 2-byte aligned length to make sure
      that if there's position array (uint16[]) it has the right alignment.
      The patch changes that so that the padding is not done when there's no
      positions. That makes the storage of tsvectors without positions
      slightly more compact.
      
      - added some #include "miscadmin.h" lines I missed in the earlier when I
      added calls to check_stack_depth().
      
      - Reimplement the send/recv functions, and added a comment
      above them describing the on-wire format. The CRC is now recalculated in
      tsquery as well per previous discussion.
      978de9d0
    • Teodor Sigaev's avatar
      Improving various checks by Heikki Linnakangas <heikki@enterprisedb.com> · 8983852e
      Teodor Sigaev authored
      - add code to check that the query tree is well-formed. It was indeed
        possible to send malformed queries in binary mode, which produced all
        kinds of strange results.
      
      - make the left-field a uint32. There's no reason to
        arbitrarily limit it to 16-bits, and it won't increase the disk/memory
        footprint either now that QueryOperator and QueryOperand are separate
        structs.
      
      - add check_stack_depth() call to all recursive functions I found.
        Some of them might have a natural limit so that you can't force
        arbitrarily deep recursions, but check_stack_depth() is cheap enough
        that seems best to just stick it into anything that might be a problem.
      8983852e
    • Teodor Sigaev's avatar
      Refactoring by Heikki Linnakangas <heikki@enterprisedb.com> with · e5be8998
      Teodor Sigaev authored
      small editorization by me
      
      - Brake the QueryItem struct into QueryOperator and QueryOperand.
        Type was really the only common field between them. QueryItem still
        exists, and is used in the TSQuery struct as before, but it's now a
        union of the two. Many other changes fell from that, like separation
        of pushval_asis function into pushValue, pushOperator and pushStop.
      
      - Moved some structs that were for internal use only from header files
        to the right .c-files.
      
      - Moved tsvector parser to a new tsvector_parser.c file. Parser code was
        about half of the size of tsvector.c, it's also used from tsquery.c, and
        it has some data structures of its own, so it seems better to separate
        it. Cleaned up the API so that TSVectorParserState is not accessed from
        outside tsvector_parser.c.
      
      - Separated enumerations (#defines, really) used for QueryItem.type
        field and as return codes from gettoken_query. It was just accidental
        code sharing.
      
      - Removed ParseQueryNode struct used internally by makepol and friends.
        push*-functions now construct QueryItems directly.
      
      - Changed int4 variables to just ints for variables like "i" or "array
        size", where the storage-size was not significant.
      e5be8998
  4. Aug 21, 2007
  5. Feb 28, 2007
  6. Nov 22, 2005
  7. Nov 08, 2005
    • Teodor Sigaev's avatar
      New features for tsearch2: · 0645663e
      Teodor Sigaev authored
      1 Comparison operation for tsquery
      2 Btree index on tsquery
      3 numnode(tsquery) - returns 'length' of tsquery
      4 tsquery @ tsquery, tsquery ~ tsquery - contains, contained for tsquery.
        Note: They don't gurantee exact result, only MAY BE, so it
        useful only for speed up rewrite functions
      5 GiST index support for @,~
      6 rewrite():
              select rewrite(orig, what, to);
              select rewrite(ARRAY[orig, what, to]) from tsquery_table;
              select rewrite(orig, 'select what, to from tsquery_table;');
      7 significantly improve cover algorithm
      0645663e
Loading