# Searching strings, and length

**URL:** <https://boards.straightdope.com/t/searching-strings-and-length/290559>\
**Category:** About This Message Board\
**Created:** [February 17, 2005, 4:30pm UTC](https://boards.straightdope.com/t/searching-strings-and-length/290559 "2005-02-17T16:30:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johnny\_L.A](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johnny_l.a/32/1084_2.png) [@Johnny\_L.A](https://boards.straightdope.com/u/Johnny_L.A)\
**Post date:** [February 17, 2005, 4:30pm UTC](https://boards.straightdope.com/t/searching-strings-and-length/290559/1 "2005-02-17T16:30:01Z")

</div>

1. How do you search for a string using the search function. I haven’t tried it recently, but I seem to recall that when I used quotaion marks, the search engine looked for the quotation marks in addition to the words.

2. Why must there be a four-character minimum for search parameters? ISTR that the limit was placed to prevent people from maliciously bogging down the server. Since only registered (i.e., paying) members are allowed to use the search function, why can’t this limit be removed? For example, I wanted to look for ‘luck of the pot’. Can’t do it. There are other legitimate three-character words that people have wanted to find, but were not allowed to as well.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [February 17, 2005, 6:54pm UTC](https://boards.straightdope.com/t/searching-strings-and-length/290559/2 "2005-02-17T18:54:36Z")

</div>

It may be that in our current situation, 3 characters is a more appropriate limit than 4, but to change it would require that the search index be completely rebuilt. I don’t know how much, exactly, this would entail, but I would not be surprised to hear a day of downtime for it. Is it worth it? I dunno.

---

<div class="post-metadata">

**Author:** ![rowrrbazzle](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/rowrrbazzle/32/414_2.png) [@rowrrbazzle](https://boards.straightdope.com/u/rowrrbazzle)\
**Post date:** [February 17, 2005, 7:27pm UTC](https://boards.straightdope.com/t/searching-strings-and-length/290559/3 "2005-02-17T19:27:01Z")

</div>

> [@Johnny L.A.](#):
>
> For example, I wanted to look for ‘luck of the pot’. Can’t do it.

That’s odd. I just tried it and got both your OP here and your post in Comments on Staff Reports. What message did you get originally? Maybe the search did go through, but there just weren’t any results when you tried. The less-than-perfect state of the index might be a factor.

Here’s an earlier thread that refers to searching with quoted strings: [http://boards.straightdope.com/sdmb/showthread.php?t=265445](http://boards.straightdope.com/sdmb/showthread.php?t=265445)

---

<div class="post-metadata">

**Author:** ![Johnny\_L.A](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johnny_l.a/32/1084_2.png) [@Johnny\_L.A](https://boards.straightdope.com/u/Johnny_L.A)\
**Post date:** [February 17, 2005, 7:41pm UTC](https://boards.straightdope.com/t/searching-strings-and-length/290559/4 "2005-02-17T19:41:04Z")

</div>

> [@rowrrbazzle](#):
>
> That’s odd. I just tried it and got both your OP here and your post in Comments on Staff Reports. What message did you get originally? Maybe the search did go through, but there just weren’t any results when you tried. The less-than-perfect state of the index might be a factor.

I typed in “luck of the pot” (with the double quotation marks) and the message was something like ‘The following words are too common, or are too short’ followed by “of”, “the”, “pot”.

---

<div class="post-metadata">

**Author:** ![Johnny\_L.A](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johnny_l.a/32/1084_2.png) [@Johnny\_L.A](https://boards.straightdope.com/u/Johnny_L.A)\
**Post date:** [February 17, 2005, 7:57pm UTC](https://boards.straightdope.com/t/searching-strings-and-length/290559/5 "2005-02-17T19:57:27Z")

</div>

Okay. I just tried “luck of the pot” in Advanced Search, Any Date, General Questions:

> [@](#):
>
> Sorry - no matches. Please try some different terms.
> 
> The following words are either very common, too long, or too short and were not included in your search : of, the, pot

Searching all open forums brings up the two recent results.

I _know_ I used the phrase in GQ though.

---

<div class="post-metadata">

**Author:** ![milquetoast](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@milquetoast](https://boards.straightdope.com/u/milquetoast)\
**Post date:** [February 18, 2005, 2:06pm UTC](https://boards.straightdope.com/t/searching-strings-and-length/290559/6 "2005-02-18T14:06:27Z")

</div>

Is this the thread you are looking for?

[What is the history of potluck?](http://boards.straightdope.com/sdmb/showthread.php?t=222547&highlight=of+the+pot)

I did a search on just “of the pot” (no luck) including the quotes in the search field. I restricted it to posts by **Johnny L.A.** in GQ with no timeframe restriction.

For some reason, it highlights of, the, and pot only where the word is not next to a quotation mark. That gives me the impression that it does a _whole word_ search only, and the quote marks in your post mean that “luck and pot” in your post are considered different _words_ than luck and pot in your search parameters just because they abut quote marks.

---

<div class="post-metadata">

**Author:** ![carterba](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@carterba](https://boards.straightdope.com/u/carterba)\
**Post date:** [February 18, 2005, 4:02pm UTC](https://boards.straightdope.com/t/searching-strings-and-length/290559/7 "2005-02-18T16:02:37Z")

</div>

I assume the search works by SQL querying all posts. If that’s the case, then shorter words make for much less efficient querying. Plus, very common words will result in way too many matches: “of” or “the” would probably hit about 90% of all the posts ever made.

The vBulletin out-of-the-box search simply wasn’t built for boards with hundreds of thousands of posts. Y’all should create a true inverted index of posts. I bet it would take less than an hour to build the initial index, and new posts could be added to the index incrementally. Searching would then be much faster for the user, much more efficient on the server, and the results would probably be better as well.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [February 18, 2005, 6:20pm UTC](https://boards.straightdope.com/t/searching-strings-and-length/290559/8 "2005-02-18T18:20:56Z")

</div>

I don’t know all the technical details, but we are already using a search index of some sort, to which posts are continually added. It’s still slow. And words like “the” would obviously not be useful for searches, but that’s what the badwords file is for. The number of common, search-clogging three-letter words like “the” is far less than the number of specific, search-useful words like “OSX” or “Gnu”.
