Wiki
Clone wikiq2a-advanced-search-public / Home
AS - Advanced Search
Table of contents:
Description
AS is a Question2Answer plugin that extends the way in which Q2A searches for posts and allows the user to get better results when searching.
Features
- Filter posts by question tags
- Filter posts by username
- Filter posts only by question title or post content instead of both
- Ability to force and exclude words or tags in the results
- Combine tag, title, content, username searches in a single query
- New ways of filtering questions (amount of views, amount of answers, score, close status and selected answer status)
- Small and handy widget can be included for a quick reference
- A page can be added which details how to use the advanced search
- Ability to change the included widget or page by means of a simple HTML page
- Very simple installation: Copy the plugin directory
pupi-as
into theqa-plugin
directory - Upgrade system support: The plugin will be able to properly upgrade from previous versions
- Simple setup: Just navigate to Admin > Lists and in the Use search module section change it to PUPI AS Search
- External users support
Notes:
- This plugin has exactly the same requirements and works in a similar way as the standard Q2A search in terms of external users. External users must already be working and configured to work with the standard Q2A search before installing this plugin. No support will be given for this specific feature as it depends on other systems
- Changes to CSS might be required depending on the selected theme in order for the page and widget to be properly displayed. It has been tested with several open source themes and they all seem to work fine. However, no support will be provided for updating the page or widget
Requirements
These are the technical requirements for the plugin to work properly:
- PHP version 5.2+
- Q2A core version 1.7.*, 1.8.*
Sample usage and screenshots
This plugin aims at getting a better Q2A site by means of giving users the information they are looking for. The standard Q2A search has the ability to search for words, tags and users. However, it has a strong downside: every word input generates a new set of matches that are added to the results. This means the more words are being looked for the more results there will be. This generates huge result sets while the user is looking for a small subset.
Taking this into account, the AS plugin focuses on allowing the user to narrow down results based on their input. In that way it allows the user to specify which part of the posts to match (title, content, tags or author username) against each particular word. It also gives the user the ability to force a particular match or to exclude the presence of a word.
Some additional question filters have been added. They provide the ability to filter by a minimum amount of views, a minimum question score, a minimum amount of answers per questions, whether the question is closed or not and whether the question has a selected answer or not.
Detailed search tools
-
To search within specific tags, prefix them with
tag:
followed by the tag. As tag can contain special characters you can surround them with quotes. Examples:apple tag:fruit
searches for mentions ofapple
within thefruit
tag.apple tag:"round fruit"
searches for mentions ofapple
within theround fruit
tag.
-
To limit your search to just the title of a question, use
title:
followed by the search term. Likewise, search the content only (excluding the title) withcontent:
followed by the search term. Examples:apple
searches for mentions ofapple
in the title of questions or content of posts.title:apple
searches for mentions ofapple
only in the title of questions.content:apple
searches for mentions ofapple
only in the content of posts.
-
To search for questions and answers for a given user you can prefix the username (which is usually used as the login id) with
user:
. Note as usernames can contain special characters you can use quotes to cover the whole username. Examples:user:martin
searches for questions and answers created by usermartin
.user:"martin smith"
searches for questions and answers created by usermartin smith
.
-
To exclude results from a tag or word, prefix it with
-
in your query. Examples:apple -tag:green
finds posts that mentionapple
and are not in questions tagged asgreen
.-apple tag:green
finds posts in questions that are tagged asgreen
and do not contain the wordapple
.
-
Adding multiple usernames, tags or words with no prefix to a search means that at least one of them must match. In order to force the matching of more than one word then prefix that word with a
+
. Note in the case of usernames it is possible to add more than one but the+
has no effect. Bear in mind that searching using only negative terms yield no result. Examples:green apple
finds posts that mention eithergreen
orapple
.+green +apple
finds posts that mention both:green
andapple
.user:martin user:peter +tag:fruit +tag:round
finds posts from userpeter
ormartin
that are tagged withfruit
andround
.-tag:fruit
finds no posts because it is a fully negative search; something needs to be matched in order to be subtracted from it.
Additional question filters
Here are some additional search filters that can be applied to the questions matching a search. Note they can not be used in its own.
-
To search for posts in questions that have received at least a certain amount of views you can include
views:
followed by the expected minimum amount of views. Example:apple views:100
searches for posts that mentionapple
in questions with at least100
views.
-
To search for posts in questions with at least a certain score you can include
score:
followed by the expected minimum score. Example:apple score:10
searches for posts that mentionapple
in questions with a score of10
or higher.
-
To search for posts in questions with at least a certain amount of answers you can include
answers:
followed by the expected minimum amount of answers. Example:apple answers:2
searches for posts that mentionapple
in questions that contain at least2
answers.
-
To search for posts in questions that have an accepted answer (or not) you can include
isaccepted:
followed bytrue
orfalse
. Example:apple isaccepted:true
searches for posts that mentionapple
in questions with an accepted answer.
-
To search for posts in questions that have been closed (or not) you can include
isclosed:
followed bytrue
orfalse
. Example:apple isclosed:true
searches for posts that mentionapple
in questions that have been closed.
Page and widget
The AS plugin also comes with an optional Q2A page that can be added and removed as any other page. It contains a description and examples of all search modifiers. A part from this page, there is also a widget that can be added and removed to the site as any other widget. It contains a quick reference for the search modifiers.
Here is a screenshot of the page:
Here is a screenshot of the widget, right below the search box:
The default widget state is collapsed so that it takes less space. The user can expand it on demand.
Bear in mind the page and widget will have to be adapted to your needs. For example, if your site does not support tags, you will have to take care of removing tag references in both: the page and the widget.
Support
Technical support must all go through the issues section in this site and be in English.
- Bugs: If you find a bug or error in the plugin, create a bug issue detailing the steps needed to be performed in order to reproduce the issue. Provide the steps from scratch, i.e., starting just after a clean Q2A setup. Attaching screenshots might be useful too. Also include your PHP, MySQL, Q2A and plugin versions. Make sure you have no other plugin in the
qa-plugin
directory while reproducing it. - New features: Feel free to request features using the issues section. Select the enhancement kind in the combobox and explain in detail the feature and why you consider it would be useful to others.
- Questions and other support: Create a task issue explaining the situation in detail.
Administrative (all non-technical) issues should go through private message to my profile in the Q2A site. Make sure to provide your email address.
Get the plugin
Click here to navigate to the main plugin page. From there, you will be able to buy the plugin.
Updated