Questions tagged [text-search]

202 questions
5
votes
3 answers

MongoDB: Text search (exact match) using variable

MongoDB 3.4 I have a value in a variable. val1 = "Fort Minor" I need to search in a collection stores (with text index on name field) with documents as db.stores.insert([ { _id: 1, name: "Java Hut", description: "Coffee and cakes" }, {…
Chakraborty
  • 123
  • 1
  • 2
  • 8
5
votes
2 answers

How to implement Text Search in CefSharp

I'm building an application using CefSharp and need to provide text search functionality to user just like Google Chrome has. Can any one help me with the implementation of text search in CefSharp?
Ashish Rathore
  • 2,546
  • 9
  • 55
  • 91
5
votes
0 answers

MongoDB Index optimization when using text-search in the aggregation framework

We are building a simplified version of a search engine on top of MongoDB. Sample data set { "_id" : 1, "dept" : "tech", "updDate": ISODate("2014-08-27T09:45:35Z"), "description" : "lime green computer" } { "_id" : 2, "dept" : "tech", "updDate": …
4
votes
8 answers

efficient algorithm for searching one of several strings in a text?

I need to search incoming not-very-long pieces of text for occurrences of given strings. The strings are constant for the whole session and are not many (~10). Additional simplification is that none of the strings is contained in any other. I am…
davka
  • 13,974
  • 11
  • 61
  • 86
4
votes
1 answer

How to search a buffer for a numeric range which contains a given value

I have a buffer which holds some lldb output which contains a lot of address ranges like [0x00007fff60489000-0x00007fff604c0000). Given an address (in hex as well), how would I search for a range which contains that address? I assume this will need…
Bwmat
  • 4,314
  • 3
  • 27
  • 42
4
votes
1 answer

Regex to search and replace text in a large file

I am searching for a multiline pattern in a huge file and if found need to replace the contents. I want to accomplish this in a memory efficient way. My current implementation reads text from file in chunks in 4096 bytes. Then it applies regex…
Chinmay
  • 731
  • 1
  • 8
  • 19
4
votes
4 answers

Fast file search algorithm for IP addresses

Question What is the fastest way to find if an IP address exists in a file that contains IP addresses sorted as: 219.93.88.62 219.94.181.87 219.94.193.96 220.1.72.201 220.110.162.50 220.126.52.187 220.126.52.247 Constraints No database (e.g.,…
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
4
votes
2 answers

MongoDB text search logical AND

MongoDB seems to only do logical OR text queries? If I want to find all documents that contain the words ('apple' or 'orange' or 'pear') I can do the following. db.collection.runCommand('text', {search: 'apple orange pear', limit: -1}) But how do I…
Cathal Coffey
  • 1,105
  • 2
  • 20
  • 35
3
votes
4 answers

MongoDB - searching text

What is the best strategy for selecting mongodb entries in which a string value contains a set of words or phrases? I'm thinking of something equivalent to mysql's LIKE function, e.g. WHERE (TEXT LIKE "% apple %") or (TEXT LIKE "% banana…
Stuart
  • 1,251
  • 2
  • 11
  • 18
3
votes
1 answer

What is the GitHub search syntax for mandatory search terms?

What is the syntax for specifying that words must appear in the results of a GitHub search? - Similar to using the double quotes around words in a Google search.
Phillip Ngan
  • 15,482
  • 8
  • 63
  • 79
3
votes
2 answers

How to make substring-matching query work fast on a large table?

I have a large table with a text field, and want to make queries to this table, to find records that contain a given substring, using ILIKE. It works perfectly on small tables, but in my case it is a rather time-consuming operation, and I need it…
Pupkov-Zadnij
  • 1,342
  • 2
  • 11
  • 21
3
votes
1 answer

Tackling MongoDB single text index limit

I have a collection of around 200m documents. I need to build a search for it that looks for substrings. Using a regex search is incredibly slow even with a regular index on the field being searched for. The answer seems to be a text index but…
Guerrilla
  • 13,375
  • 31
  • 109
  • 210
3
votes
1 answer

How to create an index for partial text search on MongoDB?

I'm following the tutorial instruction: https://docs.mongodb.com/manual/core/index-text/ This is the sample data: db.stores.insert( [ { _id: 1, name: "Java Hut", description: "Coffee and cakes" }, { _id: 2, name: "Burger Buns",…
Vũ Anh Dũng
  • 980
  • 3
  • 13
  • 32
3
votes
2 answers

Mongodb text search exact phrase

I have a collection with following docs: { "_id" : ObjectId("5ad609a2ac1a8b644180936a"), "content" : "Coffee and cakes..." }, { "_id" : ObjectId("5ad609baac1a8b644180936b"), "content" : "coffee shop..." } Result of the text search…
3
votes
2 answers

MongoDB text search - Match exact tokens in a string

I have fallen in a case where I need to do a $text $search in MongoDB by matching exact tokens within a string. I thought I can resolve this by creating a text index without a default language and perform the query by wrapping each token with…
Fernando Aspiazu
  • 953
  • 1
  • 10
  • 28
1
2
3
13 14