473,725 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1532
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(resultLis t,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
4052
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 thesaurus appear at many places in my texts, but they are often misspelled, just slightly different from the thesaurus. Now I'm looking for the best strategy to match the appearence of my thesaurus items in the texts. Do I have to build patterns...
2
4495
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 space (or comma) character as a delimiter. I can do one or the other, tokenize the words or tokenize the double-quoted strings, but I can't figure out how to combine the two into the same regex expression. Note: I *do* want to capture (retain)...
7
1389
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 these key words and phrases can save you a lot of grey hairs and wasted time. Think of them as a form of triage, a method of identifying those among the wounded that will take up too much time to save, allowing you to concentrate on the ones that...
11
5125
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
5974
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 of either signed 16 or 24 bit integers. What is the best way of defining these types to allow some level of portability? Is it simply a matter of using conditional preprocessor inclusions to create a type suitable for a particular machine? Such...
3
3080
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 regular expression needs to return me collection as 1. "these words out" 2. "some more words" Please help me out. Thanks,
1
1031
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 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.
0
8872
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9246
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9162
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9091
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5997
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4773
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2619
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2150
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.