[Pmwiki-users] enhanced search?
Patrick R. Michaud
pmichaud at sci.tamucc.edu
Tue Apr 29 07:28:48 CDT 2003
John Rankin suggested:
> 4. slightly enhanced search
> I have been asked if there is a way to limit a search to a
> specified group. I know pmwiki's search function is deliberately
> basic, but I'd like to propose that a searcher can enter
> 'group:search text' in the search box.
I started to implement this and then realized that John had a differing
interpretation of the search syntax than I did. So, I'm kicking this one to
the list to see if folks have preferences about how it should look.
John's suggestion was to limit searches by placing the group name
and colon at the beginning of the search text. Thus, specifying search
text of "Main:apple pie" would find all occurrences of "apple pie" in pages
in the Main group. This is fine with me and I can easily implement this in
pmwiki.php if that is the preference.
But, my thought in response to John's suggestion was to follow a Google-like
syntax and allow "group:Main" to appear in the search text box to limit
the search to a group (analogous to Google's site: syntax that limits
search results to pages in a specific domain). Thus the search string
"group:Main apple pie" would display all pages in group Main
containing the phrase "apple pie". Or, one could enter "apple pie group:Main"
to achieve the same thing.
As long as I'm working on searching I don't think I'd be opposed to
moving closer to a Google-like search syntax, thus
Search term Results
apple All pages containing "apple"
apple pie All pages containing "apple" and "pie"
"apple pie" All pages containing "apple pie"
apple -pie All pages containing "apple" but not "pie"
apple pie group:Main All pages in Main containing "apple" and "pie"
If we take this approach we might also force word boundaries on search
terms, thus searches for "apple" would not find "pineapple", "applet",
or "grapples" (currently PmWiki's search function returns any page
containing the search string even if the thing being searched for is part
of a bigger word).
Note that the search function would still be fairly simplistic and
might not scale well to tens of thousands of pages. (If large
site searching is needed, I recommend getting a "real" search engine.)
However, the improvements above would be useful for many installations
of PmWiki.
Comments?
Pm
More information about the pmwiki-users
mailing list