Advertisement
cmptrwz

Search Issues

Sep 17th, 2012
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. Search Issues:
  2.  
  3. 1. Negating only won't find records that don't have the metabib.*_field_entry at all. (Not an issue when including that category, obviously)
  4.  
  5. Example: A search with "subject: -xyzzy" will not show any records that have no subjects at all.
  6.  
  7. Possible Solution: Detect "negated only" (all ! prefixed) and change to support "IS NULL" instead of "IS NOT NULL", or possibly add a NOT before the entire thing, removing the ! and using | instead of & in the tsquery.
  8.  
  9. 2. Negating won't work if there is even a single field entry row without the negated value. Most commonly visible with things like Subject, but can apply to other fields like Author.
  10.  
  11. Example: harry potter subject: hogwarts -magic - Will likely still show harry potter books, even though they contain the subject "magic", because the subject "hogwarts" matches a row that doesn't contain "magic"
  12.  
  13. Possible Solution: Create a metabib.combined_*_field_entry table for each metabib.*_field_entry table containing an index_vector. The combined table would have two columns: source (pk, fk) and index_vector (combined index_vectors of all rows in the table). Non-phrase searches would base on the combined index_vector instead of individual rows. Phrase searches would be left alone. May need to join to the non-combined table for relevance ranking.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement