Questions tagged [search]

Questions about search algorithm mechanics and implementation. *NOT* for questions about using search tools within an API (e.g. Google, Bing, Facebook).

Searching is one of the most common and important tasks in Computer Science.

The most basic search algorithm is a (also called "sequential search"). Each item in a collection of data is examined in sequence until the sought item is found.

If the collection in question has already been sorted, for instance, then a more efficient is possible.

Search can become more complex when, rather than finding one instance of a specific item, we want to find all items meeting a certain set of criteria. For instance a query can specify extremely complex search criteria, and much of relational database design involves the planning of an efficient way to perform those searches.

Another more complex search scenario is graph search, in which a series of nodes and edges must be traversed. Common algorithms for this domain include and . In many cases, a heuristic search algorithm such as can achieve more efficient results by making use of additional information about the problem.


Do not use this tag for questions about specific search tools within an API. Some more relevant tags for that would be the following:

37207 questions
8
votes
1 answer

How to order search results by relevance and another field in Lucene.net

I have a requirement to sort search results by relevance and another field. I need to do something similar to this: using Lucene.Net.Search; SortField[] fields = new[] { SortField.SCORE, new SortField("customField") }; Sort sort = new…
Arnold Zokas
  • 8,306
  • 6
  • 50
  • 76
8
votes
4 answers

How do I Make a PDF searchable for a flask search application?

I have been doing research for a very important personal project. I would like to create a Flask Search Application that allows me to search for content across 100 Plus PDF files. I have found Some information around A ElasticSearch Lib that works…
BlackFox
  • 773
  • 1
  • 8
  • 24
8
votes
3 answers

Find out in linear time whether there is a pair in sorted vector that adds up to certain value

Given an std::vector of distinct elements sorted in ascending order, I want to develop an algorithm that determines whether there are two elements in the collection whose sum is a certain value, sum. I've tried two different approaches with their…
Lui
  • 153
  • 5
8
votes
1 answer

Fuzzy search in ElasticSearch doesn't work with spaces

I'm using the fuzzy search option in ElasticSearch. It's pretty cool. But I came across an issue when doing search for values that have spaces. For example say I have two values: "Pizza" "Pineapple Pizza" and I search for Pizza using this query: …
JD333
  • 501
  • 8
  • 22
8
votes
4 answers

How do you get your Fulltext boolean search to pick up the term C++?

So, I need to find out how to do a fulltext boolean search on a MySQL database to return a record containg the term "C++". I have my SQL search string as: SELECT * FROM mytable WHERE MATCH (field1, field2, field3) AGAINST ("C++" IN BOOLEAN MODE)…
Bamerza
  • 1,335
  • 1
  • 18
  • 34
8
votes
1 answer

imap "search all" scope: all folders/current folder?

I'm trying to figure out if IMAP's search (with args: "unseen all") command works by searching all folders in a mailbox, or just the currently selected folder? I.e. when selecting INBOX and issuing search command, it doesn't find any new…
antonone
  • 2,045
  • 1
  • 25
  • 35
8
votes
9 answers

Looking for a faster way to perform string searches

I have to recognize a large list of URLs (few million lines) as belonging to a particular category or not. I have another list that has sub-strings that if present in the URL belongs to that category. Say, Category A. The list of sub-strings to…
sfactor
  • 12,592
  • 32
  • 102
  • 152
8
votes
1 answer

html5 search input events

What event is triggered when a user clicks the X in a search input field (in webkit browsers) to cancel the search or clear the text? Information is available about restyling the button and other custom events, but not on using this button.
jmilloy
  • 7,875
  • 11
  • 53
  • 86
8
votes
2 answers

NodeJS: How would one watch a large amount of files/folders on the server side for updates?

I am working on a small NodeJS application that essentially serves as a browser based desktop search for a LAN based server that multiples users can query. The users on the LAN all have access to a shared folder on that server and are traditionally…
funkyeah
  • 3,074
  • 5
  • 28
  • 47
8
votes
3 answers

Filter JTable only one one column

I have a JTable and I would like to do a filter from a JTextfield but only filter the results based on one column and not to search all columns. I have my JTable I can filter but my filter will filter and search every column of the table I want to…
CMP
  • 435
  • 3
  • 8
  • 22
8
votes
4 answers

How to add a drop down next to the search input field in Android?

In the system-wide search on my HTC Desire (Froyo), I see a little drop down left to the search input field that allows to select where I want to search (All, web, apps). How can I implement this in an application of mine? The search tutorial on the…
Heiko Rupp
  • 30,426
  • 13
  • 82
  • 119
8
votes
1 answer

Constraint Satisfaction Problems with solvers VS Systematic Search

We have to solve a difficult problem where we need to check a lot of complex rules from multiple sources against a system in order to decide if the system satisfy those rules or how it should be changed to satisfy them. We initially started using…
8
votes
2 answers

Finding the most similar string among a set of millions of strings

Let's say I have a dictionary (word list) of millions upon millions of words. Given a query word, I want to find the word from that huge list that is most similar. So let's say my query is elepant, then the result would most likely be elephant. If…
Chris Vilches
  • 986
  • 2
  • 10
  • 25
8
votes
3 answers

Full-Text Substring Searching in iOS

I need my iPhone / iPad app to be able to quickly search through about 10,000 records (about a paragraph worth of text, each), for any substring contained within the record. So if the record contains the word "Flame", querying for "lame" should…
user584528
8
votes
3 answers

Visual Studio Code: Search Within Files but Exclude Folder

In Visual Studio Code (not to be confused with Visual Studio) there is a search interface (click the mag glass at top left). It has a "files to include" field, and a "files to exclude" field. I know that I can include or exclude a file from my…
zumafra
  • 1,255
  • 2
  • 13
  • 19