Questions tagged [text-search]

202 questions
3
votes
2 answers

How to access Text Score MongoDB $text search

I was successful in running $text search using Mongoose in Node.js code. Here is the code I used: Model.find( { $text : { $search : "FindThisString"}}, { score : {$meta : "textScore"}} ) .sort({ score : { $meta : 'textScore'}}) …
Ashu Joshi
  • 540
  • 3
  • 11
3
votes
4 answers

Search Text In Files Using PHP

How to search text in some files like PDF, doc, docs or txt using PHP? I want to do similar function as Full Text Search in MySQL, but this time, I'm directly search through files, not database. The search will do searching in many files that…
Hafizul Amri
  • 2,633
  • 7
  • 28
  • 30
3
votes
1 answer

How to search word or string on all fields in document with MongoDB?

We have a situation where a user would like to have a single 'omni-box' for searching for a word\phrase anywhere in a document. Is MongoDB able to perform this search or would it have to be an explicit search of every field?
BanksySan
  • 27,362
  • 33
  • 117
  • 216
3
votes
1 answer

Full Text Search in MongoDB/Node.js-mongoose-text-search

I am trying to perform full text search on MongoDB and Node.js using the mongoose-text-search plugin. I am following the example code from https://github.com/aheckmann/mongoose-text-search and my code is shown below. I keep getting an error…
srob
  • 125
  • 1
  • 6
3
votes
2 answers

Fastest way to searching word in non-indexed textfile - Python

Considering a text file of 1.5 million lines and around 50-100 words per line. To find the lines that contains the word, using os.popen('grep -w word infile') seems to be faster than for line in infile: if word in line: print line How else…
alvas
  • 115,346
  • 109
  • 446
  • 738
3
votes
1 answer

Flexible sliding window (in Python)

Problem description: I'm interested in looking at terms in the text window of, say, 3 words to the left and 3 to the right. The base case has the form of w-3 w-2 w-1 term w+1 w+2 w+3. I want to implement a sliding window over my text with which I…
sim
  • 992
  • 1
  • 7
  • 12
2
votes
3 answers

How to save searches on a WinForm

I have created a Search form with a function Find Text, How do I save the last search so I can create a Find Again Button when the form has been re-opened? My code for the search is: private void btnSearch_Click(object sender, EventArgs e) …
JaredH20
  • 370
  • 1
  • 7
  • 22
2
votes
1 answer

How to do full field match in Solr?

I want Solr to return a document only if all the tokens are present in the query. For example if a document have a text of "foo bar", then it will only be retrieved with a query like "foo bar", "foo bar baz", "bar foo baz". But not with "foo baz" or…
Kavaliro
  • 119
  • 1
  • 8
2
votes
3 answers

How to use Puppeteer to count the occurrences of a specific text on a web page?

I am working with NodeJS and the Puppeteer library to load a website and then check if a certain text is displayed on the page. I would like to count the number of occurrences of this specific text. Specifically, I would like this search to work…
Caesar
  • 9,483
  • 8
  • 40
  • 66
2
votes
2 answers

How to create search bar for name search json javascript using filter

I am creating website of student community. Having difficulty in adding Search Bar option to website. I can add normal for search but had bug for all together. How should I add name search here? const search = async()=> { let input =…
Kdhere
  • 65
  • 1
  • 7
2
votes
1 answer

MongoDB - How can I find all other related documents from all collections. I have access to only 1 id

Hello I am using mongoose to search for similar posts in my collection. /*Product model*/ const productSchema = mongoose.Schema( { writer: { type: Schema.Types.ObjectId, ref: "User", }, title:…
Samim Hakimi
  • 705
  • 8
  • 22
2
votes
3 answers

having a map of strings how to compare it to given string

We have map of string pairs like name:location (unix like absolute location a la myfolder/). We are given with some location a la myfolder/mysubfolder/myfile. How to find which of maps location fit to given url most? Example we have a map…
Rella
  • 65,003
  • 109
  • 363
  • 636
2
votes
5 answers

Look for keywords in a string in JS

I have an input field where I expect users to type text that contains 1 of many keywords that will trigger different audio files depending on the keyword. (I know that's not really smart from UX point of view but that's just a mockup/demo of a…
Gusepo
  • 837
  • 2
  • 13
  • 26
2
votes
2 answers

I can't submit json, scv, txt files to Solr

I am working on Solr. I can submit XML files but when i submit JSON, CSV or txt files: "Unsupported ContentType: application/octet-stream Not in: [application/xml, application/csv, application/json, text/json, text/csv, text/xml,…
mfatihk
  • 136
  • 2
  • 11
2
votes
6 answers

Search

I am trying to search EACH on a single HTML5 page, and then HIDE the if there is no match. I am 'almost' but not quite there. So far, my will disappear if there is a match of a single char, but then reappear if i type anything else. Also, i would…
noowie
  • 49
  • 1
  • 1
  • 8
1 2
3
13 14