Ticket #420 (closed Enhancement: fixed)
Enable more complex searches for composite topics
Reported by: | jri | Owned by: | jri |
---|---|---|---|
Priority: | Major | Milestone: | Release 4.1 |
Component: | DeepaMehta Standard Distribution | Version: | 4.0.14 |
Keywords: | Cc: | dgf, Malte, JuergeN | |
Complexity: | 3 | Area: | Data Model |
Module: |
Description
Example: find all Persons who live in Hauptstraße, Berlin (but not in Hauptstraße, Heidelberg).
Technically this is quite easy by combining a) labeling rules for composite types, and b) index modes for composite types. The developer can setup labeling rules and index modes purely declarative in JSON.
The user then uses Lucene query syntax in the webclient's search box.
Change History
comment:2 Changed 12 years ago by Jörg Richter
Contacts: add further index modes (#420, #415).
You can search a Person by its entire name, either by phrase search or boolean search e.g.
"Terry Winograd" Terry AND Winograd
You can search Persons and Institutions by combined Address terms, e.g.
Hauptstraße AND Berlin 10829 AND Berlin
For developers: you can key-search for a User Account topic by its username, e.g.
curl localhost:8080/core/topic/by_value/dm4.accesscontrol.user_account/terryw
In preparation for #415 (Easify revelation of current User Account).
See ticket 420.
See ticket 415.
comment:3 Changed 12 years ago by JuergeN
I have created a new composite "car" with aggregations "brand", "type" and "color" and composition "serial number". Now I want to search for all white BMWs by typing "BMW AND white" in the search field. But it does not find any. If I just search for "white" it finds all white cars. If I just search for BMW it finds all BMWs. Am I missing something?
comment:4 Changed 12 years ago by jri
You can't search for arbitrary combinations per-se. But when defining types, you can exploit their label rules to do combined searches in the composite topic labels.
In your case you can include "brand" and "color" in the label rule for "car". To do so, select the car type, press Edit, and check the respective "Include in Label" checkboxes. Now DM can find your white BMW. Actually it finds it in that car topic's label. The search does not really involve the car's child topics.
(The new label rule is applied to newly created topics. To apply it for an existing car topic, select it, press Edit, and press OK).
Label rules can be defined recursively.
That's all this ticket is about: combining label rules and index modes in a clever way to enable pseudo-composite searches. The standard types Person Name and Address are now defined accordingly.
(By default all types created interactively have index mode "fulltext" so you can use binary operators and wildcards.)
One way to do a real composite search would be to map the several search terms to the proper child topics. So, the user would have to specify that e.g. the search term "white" should match a Color but not the "White Eagle" brand. This is beyond this ticket.
Does this help?
Thanks for testing!