Skip to content

search an item's subitems #1885

Closed
Closed
@RogerHaase

Description

@RogerHaase

In apps/frontend/views.py there is:

@frontend.route("/+search/<itemname:item_name>", methods=["GET", "POST"])
@frontend.route("/+search", defaults=dict(item_name=""), methods=["GET", "POST"])
def search(item_name):

with the explanation:

"Currently" there is no theme generating the '/+search/<itemname:item_name>' link
within Item Views. To access, users must key the query link into the browsers URL. The
query result is filtered limiting the output to the target item, target subitems
and sub-subitems..., and transclusions within those items.
Example URL: http://127.0.0.1:8080/+search/OtherTextItems?q=moin

and more comments regarding searching transclusions of subitems:

        if show_transclusions:
            # XXX Search subitems and all transcluded items (even recursively),
            # still looks like a hack. Imaging you have "foo" on main page and
            # "bar" on transcluded one. Then you search for "foo AND bar".
            # Such stuff would only work if we expand transcluded items
            # at indexing time (and we currently don't).

Search currently has the Best Match feature:

Redirect to best match

If you know the target item name, start the search term with a back-slash character. 
Only the names and namengram fields will be searched. If there is a hit, 
the browser will be redirected to the highest scoring hit.

Searching an item's subitems could be implemented by adding a one-character prefix
to the user generated query. e.g. >mypage blue would search all sub-items of mypage for blue.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions