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
7
votes
3 answers

How do you Index Files for Fast Searches?

Nowadays, Microsoft and Google will index the files on your hard drive so that you can search their contents quickly. What I want to know is how do they do this? Can you describe the algorithm?
Unknown
  • 45,913
  • 27
  • 138
  • 182
7
votes
3 answers

Notepad++ RegEx Search/Replace: How to append and prepend a character at start and end of each file line?

How to append and prepend a character at start and end of each file line? I have this file structure: 140","Bosnia 160","Croatia 170","Serbia 180","Montenegro 200","Slovenia What I need is to add a double quote " at the start and at the end of each…
user798596
7
votes
2 answers

how to search negative number in solr?

In solr I want to search one field with negative number like nodeId:-1. in schema.xml, I defined it like this: solr throws error when use "nodeId:-1" to search like this: …
user1058984
  • 73
  • 1
  • 4
7
votes
1 answer

How to boost longer ngrams in solr?

I use following filter in the schema.xml: How can I boost the longer ngrams? For example, when I search for "bookpage", a document which contains "bookpage"…
ndee
  • 225
  • 3
  • 13
7
votes
1 answer

Django haystack: Boosting search results if the searchterm appears in a specific field

I'm using django-haystack for searching on my site. My problem is, I would like to have search results on top if the search term was found in a specific field. Let's say I search for blog-entries, then I would like to show those results on top…
scherlock
  • 217
  • 3
  • 8
7
votes
5 answers

How to reset stop words in MYSQL?

I want to reset stop word list in mysql for FULLTEXT search. I have installed WAMP Server in my system which have phpmyadmin to access mysql. But I dont know how to reset stop word in phpmyadmin. Can anyone please tell me how to do that. I also…
djmzfKnm
  • 26,679
  • 70
  • 166
  • 227
7
votes
1 answer

google search results in iframe alternative

I don't think it's possible from what I've read, but wanted to see if anyone else was in a similar situation and found a more elegent solution to this problem. Basically I have a site I am building, nothing fancy, which consists of a header section,…
Eds
  • 533
  • 4
  • 16
  • 35
7
votes
6 answers

Data structure / algorithm for query: filter by A, sort by B, return N results

Imagine that you have a large set of #m objects with properties A and B. What data structure can you use as index(s) (or which algorithm) to improve the performance of the following query? find all objects where A between X and Y, order by B, return…
Luís Marques
  • 991
  • 1
  • 10
  • 20
7
votes
2 answers

Lucene - searching for a numeric value field

ok, i have searched for this in the past two hours with results that only give's tips, and not even one complete code to the rescue ( how would noobs learn if they cant see some samples ? ) i have created an index like so: Directory directory =…
Rafael Herscovici
  • 16,558
  • 19
  • 65
  • 93
7
votes
1 answer

Solr for Arabic

I'm using Solr to index documents in 3 langues(arabic, french and english), I have used this fieldType :
7
votes
2 answers

how can i store elasticsearch settings+mappings in one file (like schema.xml for Solr)

How can I store elasticsearch settings+mappings in one file (like schema.xml for Solr)? Currently, when I want to make a change to my mapping, I have to delete my index settings and start again. Am I missing something? I don't have a large data set…
jbattle
  • 143
  • 2
  • 10
7
votes
1 answer

enable pressing tab to search in google chrome on my website

Possible Duplicate: How to add google chrome omnibox-search support for your site? I have a question about how to enable the "press tab to search" feature in google chrome for my own website. I already linked an opensearch.xml document and I have…
chourobin
  • 4,004
  • 4
  • 35
  • 48
7
votes
2 answers

depth-first graph search that returns path to goal

I've been trying this all week and cannot, for the life of me, figure it out. I know that I need to have a helper function that will recurse and return pathSoFar. I can't seem to get my head around the recursion. I'm so confused that I can't even…
mikey555
  • 432
  • 3
  • 8
  • 19
7
votes
5 answers

Regex - Get string between two words that doesn't contain word

I've been looking around and could not make this happen. I am not totally noob. I need to get text delimited by (including) START and END that doesn't contain START. Basically I can't find a way to negate a whole word without using advanced…
rrr
  • 73
  • 1
  • 4
7
votes
2 answers

Smallest code possible to filter checkboxlist through javascript

Project doesn't need any javascript libraries such as jQuery, Dojo, Prototype so there is no easy way i suppose. I would like to have in-depth answers for the question explaining how would one do this. As most of you might know asp.net checkboxlist…
Deeptechtons
  • 10,945
  • 27
  • 96
  • 178