473,398 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Querying words instead of phrases

Hi,

My website's search function looks up entire phrases instead of
individual words. For example, if I query "Google Groups," I would
like my search to come up with everything in my database that has the
words "Google" and "Groups," not just the phrase "Google Groups." I
would want my search to bring back "Google-tastic Search" or "Group
Compu-Google." Right now it only brings back "Google Groups #1,"
"Google Group #2," etc.

I'm at a loss at how to begin implementing this change. Any
suggestions? I'm working with ASP files, Javascript and HTML. Thanks
in advance for any help.

tyv
Feb 29 '08 #1
2 1513
On Feb 29, 12:58 pm, Cubicle Intern <vyts...@gmail.comwrote:
Hi,

My website's search function looks up entire phrases instead of
individual words. For example, if I query "Google Groups," I would
like my search to come up with everything in my database that has the
words "Google" and "Groups," not just the phrase "Google Groups." I
would want my search to bring back "Google-tastic Search" or "Group
Compu-Google." Right now it only brings back "Google Groups #1,"
"Google Group #2," etc.

I'm at a loss at how to begin implementing this change. Any
suggestions? I'm working with ASP files, Javascript and HTML. Thanks
in advance for any help.

tyv
You could split the search phrase by spaces, then query each word
individually. Then, merge the lists in such a way that items that
appear in both lists appear at the top of your results page.
Feb 29 '08 #2
"Cubicle Intern" <vy*****@gmail.comschreef
Hi,

My website's search function looks up entire phrases instead of
individual words. For example, if I query "Google Groups," I would
like my search to come up with everything in my database that has the
words "Google" and "Groups," not just the phrase "Google Groups." I
would want my search to bring back "Google-tastic Search" or "Group
Compu-Google." Right now it only brings back "Google Groups #1,"
"Google Group #2," etc.

I'm at a loss at how to begin implementing this change. Any
suggestions? I'm working with ASP files, Javascript and HTML. Thanks
in advance for any help.
If you want to display only those results that match all words in the search
text, you would proceed as follows:
search the database for all matches on the first word
search the results for all matches on the second word
etc

In pseudo code:
resultList = match(database,words[0])
n = 1
while (n<words.length) { resultList = match(resultList,words[n]); n++ }

Tom
Feb 29 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Christoph Pingel | last post by:
Hi all, an interesting problem for regex nerds. I've got a thesaurus of some hundred words and a moderately large dataset of about 1 million words in some thousand small texts. Words from the...
2
by: Robert Oschler | last post by:
Can someone give me a regex expression that will split a sentence containing words and double-quoted phrases, into an array? I don't want the words between the double-quotes to be split using the...
7
by: Kevin Spencer | last post by:
Greetings Fellow Inmates, My partner in crime and I have been compiling some observations regarding key words and phrases to watch out for in newsgroup postings. Employing an understanding of...
11
by: Olaf \El Blanco\ | last post by:
How can i generate random words? ('a'..'z') Is there any function that convert a number to it ascci char? My english is horrible! Here an example: function(65) return 'a'; Thank you!
9
by: Robert Dow | last post by:
Thanks for the comments on my last post, they were very useful. Here is another question that it would be useful to get some comments on. I deal a lot with sound data which comes in a fixed format...
3
by: RockyDev | last post by:
Hi All, I need a regular expression wherein i can find out phrases between double quotes. eg. string: this is sentence where i want "these words out" and also "some more words" out So...
1
by: Cubicle Intern | last post by:
Hi, My website's search function looks up entire phrases instead of individual words. For example, if I query "Google Groups," I would like my search to come up with everything in my database...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.