SID-02302: Search finds the text in Parent-Topic-Name
| Status: |
Answered |
TWiki version: |
6.0.0 |
Perl version: |
v5.10.0 |
| Category: |
CategorySearch |
Server OS: |
Suse Linux Enterprise Server 11 SP1 |
Last update: |
8 years ago |
I have following situation
In my Web "ServicePortfolioManagement" I have a Topic "ServicePortfolioManagement" which is the parent for "ApplikationsListe" which is parent for "PanDa405" which ist parent for some topics starting with the Name "SpmSchnittstelle" (i.E. SpmSchnittstelleGeschaeftspartnerreplikation
SpmSchnittstellePanda001Replikation
SpmSchnittstellePanda005StadaktionAnfrageFambeih, etc.)
The content of the topics starting with "SpmSchnittstelle" consists of the Name of another Applikation who uses this "SpmSchnittstelle"
With a %SEARCH I want to find all topics starting with "SpmSchnittstelle" and the content of the text contains i.e. "!PanDa405".
%SEARCH{"PanDa405" topic="SpmSchnittstelle*" format=" * $topic" scope="text" type="literal"}%
Now the problem is, that the search-result contains topics where the text I'm looking for (PanDa405) is NOT located in the body of the topic, but as PARENT-Topicname.
But I want only the topics, where the search-pattern is located in the body-text.
I tried it - if I remove the parent-topic from a topic "SpmSchnittstelle", it is no longer found by the search.
--
Peter Starek - 2017-02-27
Discussion and Answer
Yeah, that's a side effect of literal searches being based on a plain
grep which isn't too sensitive about metadata.
As ever so often, the
QuerySearch comes to the rescue. Compare those two searches:
%SEARCH{"PanDa405" topic="SpmSchnittstelle*" format=" * $topic" scope="text" type="literal"}%
%SEARCH{"text~'PanDa405'" topic="SpmSchnittstelle*" format=" * $topic" scope="text" type="query"}%
The second stanza is a query search, asking "does the
text match 'PanDa405'". Query search is a bit of a learning curve, but provides an excellent fine tuning of what is being searched.
--
Harald Jörg - 2017-03-02
Many Thanks - a little correction does the right thing "text~'*PanDa405*'" -- the asterisks around
PanDa405 are necessary
--
Peter Starek - 2017-03-03
Thanks for the correction! In my attempt to create a simple test case I've created a Topic where the text contained nothing but PanDa405. I've failed the "Everything should be made as simple as possible,
but not simpler" test
--
Harald Jörg - 2017-03-04
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.