Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Search Issues:
- 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)
- Example: A search with "subject: -xyzzy" will not show any records that have no subjects at all.
- 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.
- 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.
- 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"
- 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