From Habari Project
Habari has robust built-in search capabilities to help you find the content you're looking for. On any Manage page or on the Comments page, you can search in a variety of ways.
The first way to search is by keyword. Just type your search term–that is, whatever you're searching for–in the search field at the top of the Manage page then press "Return".
Next to the search field is a Habari drop button that lets you narrow your search based on information about the post or comment. Your options vary for posts or comments.
The drop button will have the following options to help you search posts:
- This will narrow your search down to just posts that have not yet been published.
- This will show only those posts that have been published.
- If a post is scheduled to be posted automatically sometime in the future, this option will show those posts.
- If you've deleted something, this option will show those posts. This option requires the Undelete plugin to be installed and activated.
The next options are based on what content types you have installed in Habari. By default, Habari comes with "Entry" and "Page" content types. You can narrow your search to only posts of that type.
Each option is a "toggle". You turn it on by clicking it. A checkmark will appear next to it. You can turn it off by choosing it again. The checkmark will disappear.
Habari also has built-in keywords that you can use to search your posts. Use these to narrow your search. To use a keyword, type the keyword followed by a colon and then a search term.
- searches for a post whose author contains the search term.
- Searches posts' tags for the search term.
Each option in the search drop button is actually a shortcut to a keyword; you may type "Status:" and then the desired status instead of using the drop button.
The drop button will have the following options to help you search comments:
- Show only approved comments.
- Show only comments that have not yet been approved.
- Show all comments that Habari thinks are spam.
You can also use keywords to search comments—author and status are supported keywords for comments.
Searching for Multiple Criteria
When a given keyword is used more than once, an implicit OR is specified. This is in contrast to non-keyword search terms where there is an implicit AND.
You can mix search and match search criteria. You can both type a search term and choose criteria from the drop button.
You can further narrow your search by using the chronological search. This is the dark band below the search field. It is a date-based representation of your posts. There is a loupe that lets you specify a certain time period. You can either drag the loupe to a specific time frame or you can resize the loupe to change the amount of time it represents. Only the posts that show up in the time specified by the loupe are shown.
To search for published pages containing the word "habari" you would enter: "status:published type:page habari".
If I want to find my draft entries tagged with both "random" and "funny" you would enter: "status:draft type:entry tag:random tag:funny".
The conversion of a search string into a call to Posts::get() or Comments::get() happens in the Posts::search_to_get() and Comments::search_to_get() functions.