I have a document (in this case Invoice) structure which contains multiple tables:
Invoice Header
(No. (PK), Customer Name, Customer Address, ...)Invoice Lines
(Invoice No. (PK), Line No. (PK), Description, Qty., ...)Invoice Header Comments
(Invoice No. (PK), Comment No. (PK), Comment)
When I run a search I would like to execute it against whole document (as one entity, not against separate fields (Customer Name + Customer Address + Description + Comment).
Example: All documents which have something to do with "Bicycle AND Berlin" or "Munich OR Berlin" or "'Fast delivery'"....
What approach would you recommend to solve this problem?
Should I create a separate Index table to store concatenated values from all field which I would like to index (Customer Name, Customer address, Description, Comment) - one row per document:
Document Index (Document No. (PK), Index) In this case how should I keep "Document Index" table up to date?
I tried to create indexed views which concatenate values, but got to the limitation - indexed view can't contain subselects or use other views.
I would appreciate all ideas.