1

Any of you know how to do boolean search engine in asp.net c# application, i have to search the given string (search the string using boolean logic AND,OR,NOT) in my asp.net application(only aspx and html files)...

please help me...

5
  • dont know how to split the search string according to the boolean logic.. Commented Apr 19, 2011 at 12:28
  • pardon me for lack of knowledge.. but what does that mean ? Commented Apr 19, 2011 at 12:29
  • here u can see the boolean logic.. usg.edu/galileo/skills/unit04/primer04_08.phtml Commented Apr 19, 2011 at 12:33
  • @Vasagam If I understand your question correctly, you need to do an advanced search in the files of your c# application. You don't need to do this problematically, or do this within the data of your app, but within your source code. Please edit you question to clarify what you search, where you search it and why you need to search it because, as you see from the answers you get, it's not easy to understand right now. Commented Apr 19, 2011 at 13:04
  • 1
    @DavRob60: Yes, a clarification would be useful. Since he wrote "how to do boolean search engine", I figured he needed to do it in code (i.e. implement an engine). Commented Apr 19, 2011 at 13:15

2 Answers 2

1

Basically, you need to parse the input (split the string, then iterate through the words) and construct a tree. Since the operators (AND, OR, ...) are between the keywords, you need an infix parser.

You can either write one yourself (the keyword "infix parser" should return enough Google results to get you started -- note that this is not a trivial task if you don't have at least some computer science background) or use a tool such as ANTLR, which is supposed to make writing parsers easy.

Here's a related question; I'm not sure if the answer is applicable to your case, though:

Sign up to request clarification or add additional context in comments.

Comments

0

In the find and replace window :CTRL + SHIFT + F

  • check "use" and select "regular expression"

This triangular button next to the Find what field becomes available when the Use check box is selected in Find options. Click this button to display a list of wildcards or regular expressions, depending upon the Use option selected. Choosing any item from this list adds it into the Find what string. - MSDN

So you will have to build your "boolean logic search" using Regular expression (And now you have 2 problems)

Also set the Look at these files types: to *.html;*.aspx; and Look in Entire Solution

enter image description here

2 Comments

is there any predefined function or tool for boolean search engine in asp.net..?
No, In Visual studio, the thing that is the nearest of your needs is regular expression. Meanwhile you may use a external program.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.