Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+13 votes
3.8k views
in Plugins by
edited by

The Advanced Search plugin gives users the ability to find what they're looking for. The plugin got inspired by and resembles StackOverflow's search, the #1 Q&A site in the world.

How Q2A searches for posts is a bit obscure and can only be fully understood by looking at the code. In short, it matches the query string against all posts that have at least one word from the query string in the title, content, tag or even as a username. Then it ranks everything based on a fixed criteria, such as if the word is in a title it's twice as important as if it's in an answer.

The issue with the default search is that it generates a huge amount of matches and doesn't allow the user to be more specific such as only looking for words in the title of a question or looking for content within a particular tag. These issues are the ones that the Advanced Search plugin aims to tackle.

Plugin features include:

  • Filter posts by question title, tags, author or content
  • 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)
  • A Small and handy widget can be included for a quick reference
  • External users support

Here are some examples of useful searches that should give a better idea of what the plugin does:

  • tag:math square triangle - matches posts with the words square or triangle within the math tag
  • +tag:programming-language +tag:c# user:john - matches posts with both tags programming-language and c# created by the user john
  • content:break -title:car isaccepted:true - matches posts that have the word break only in the content of the post, that don't have the word car in the question title and that have an answer accepted
  • tag:electronics -tag:computing isclosed:false views:100 - matches posts within the electronics tag that are not tagged as computing, that are not closed and that have at least 100 views

If you are interested in reading more about the plugin you can check the plugin page. There, you'll find some additional features, screenshots and how to order it. You can also find a plugin demo here.

by
These are the main strings used in commands that I understand you want to translate:
title
tag
user
content
views
score
answers
isaccepted
isclosed
true
false

How would you translate them? I'm asking mainly asking because I want to avoid issues with weird characters, encoding, spaces, etc.
by
Hi Pupi,
Thank you for your answer.
Yes, I want to translate exactly these characters into the German language (de). I don't need to use any special characters. I want to translate the characters as follows:

title --> Titel
tag --> Thema
user --> Benutzer
content --> Inhalt
views --> Ansichten
score --> Punkte
answers --> Antworten
isaccepted --> akzeptiert
isclosed --> geschlossen
true --> wahr
false --> unwahr
by
There shouldn't be any issue with that. Based on your question, I made a few updates to the code that should simplify these updates. It would only mean changing a configuration array
by
That's perfect, then I'll buy the plugin :-)

1 Answer

0 votes
by

Hi @pupi, This is a comment but not the answer. As there is no facility to add images in the comments, i have added it as an answer.

tag:gatecse-2012 in the advance search, is giving results. (please note that disk is also the tag of the question.)

However, when I try +tag:gatecse-2012 +tag:disk, it is giving no results.

by
+2
Hi. It works fine in my Q2A branch. I think it could be related to the plus sign issue (it's duplicated in your image). This is a Q2A issue that could be solved by applying this patch: https://github.com/q2a/question2answer/pull/992

Give that a try and we'll see where that leads to.

PS: Regardless of the ability to upload images (specially high quality ones), I've explained the steps to report issues here: https://bitbucket.org/pupi1985/q2a-advanced-search-public/wiki/Home#markdown-header-support
by
+1
" I think it could be related to the plus sign issue (it's duplicated in your image). This is a Q2A issue that could be solved by applying this patch: https://github.com/q2a/question2answer/pull/992"

Yes. That causes the issue. Now issue has been resolved.
...