Author Topic: Search won't find numbers...  (Read 2901 times)

Number8

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Search won't find numbers...
« on: August 05, 2009, 05:04:27 pm »
In the Search box, type 12.  Press Search.
No results returned, even though I have several Notes that have '12' both standing alone, and as part of an IP address.
Seems like a pretty dumb limitation...

OG 1.5.1

Pet

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 638
  • Always mining for solutions!
    • View Profile
    • The Bet!
Re: Search won't find numbers...
« Reply #1 on: August 05, 2009, 05:17:26 pm »
That may not work so well, but forum search does! Look what I found here, over there, and here too.

cheers
Support OpenGoo - Sponsor a Feature! | Follow me on Twitter | OG Support Chat | Did you turn debugging on?

Number8

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Re: Search won't find numbers...
« Reply #2 on: August 05, 2009, 08:52:12 pm »
 You have much better forum search skills than I do (likely), or a lot more time on  your hands to sift through all the results.
When I search on the forum for "Search" I get 6 pages of results.
When I search for "Search Numbers" I get two results, completely unrelated.

And If I find the links you found, what?  I know that OG's search capability is numbingly limited; knowing why makes little difference to my trying to find an IP address in a note, document, calendar event, etc.

It's a shocking design decision that Search won't return a note containing "192", or even the longer string "192.168.0.1".
« Last Edit: August 05, 2009, 08:54:39 pm by Number8 »

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Search won't find numbers...
« Reply #3 on: August 06, 2009, 11:38:29 am »
For a quick fix you can try this, but it will be much slower when the system is loaded. Edit file 'application/models/searchable_objects/SearchableObjects.class.php' and change around line 113 from:

Code: [Select]
    if($include_private) {
    if (substr(Localization::instance()->getLocale(),0,2) == 'zh')
    return DB::prepareString('`content` LIKE \'%' . $search_for . '%\'' . $wsSearch . $trashed . $otSearch . $columnsSearch );
    else
    return DB::prepareString('MATCH (`content`) AGAINST (\'' . $search_for . '\' IN BOOLEAN MODE)'  . $wsSearch . $trashed . $otSearch . $columnsSearch );
    } else {
    if (substr(Localization::instance()->getLocale(),0,2) == 'zh')
    return DB::prepareString('`content` LIKE \'%' . $search_for . '%\' AND `is_private` = 0' . $wsSearch . $trashed . $otSearch . $columnsSearch );
    else
    return DB::prepareString('MATCH (`content`) AGAINST (\'' . $search_for . '\' IN BOOLEAN MODE) AND `is_private` = 0' .$wsSearch . $trashed . $otSearch . $columnsSearch);
    } // if

to:

Code: [Select]
    if($include_private) {
    if (true || substr(Localization::instance()->getLocale(),0,2) == 'zh')
    return DB::prepareString('`content` LIKE \'%' . $search_for . '%\'' . $wsSearch . $trashed . $otSearch . $columnsSearch );
    else
    return DB::prepareString('MATCH (`content`) AGAINST (\'' . $search_for . '\' IN BOOLEAN MODE)'  . $wsSearch . $trashed . $otSearch . $columnsSearch );
    } else {
    if (true || substr(Localization::instance()->getLocale(),0,2) == 'zh')
    return DB::prepareString('`content` LIKE \'%' . $search_for . '%\' AND `is_private` = 0' . $wsSearch . $trashed . $otSearch . $columnsSearch );
    else
    return DB::prepareString('MATCH (`content`) AGAINST (\'' . $search_for . '\' IN BOOLEAN MODE) AND `is_private` = 0' .$wsSearch . $trashed . $otSearch . $columnsSearch);
    } // if

Please tell us how it worked for you, and if you can please try this with a big load on the system (tens of thousands of objects) and compare it to the previous search.

Thanks.

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Search won't find numbers...
« Reply #4 on: August 06, 2009, 11:40:57 am »
And of course it's not a design decision not to be able to find some stuff. We know we have to improve the search, but we also have to improve tons of other features. Sooner or later we will work on it. If you really need it you could sponsor the development of the search functionality.

Pet

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 638
  • Always mining for solutions!
    • View Profile
    • The Bet!
Re: Search won't find numbers...
« Reply #5 on: August 06, 2009, 04:16:42 pm »
You have much better forum search skills than I do (likely), or a lot more time on  your hands to sift through all the results.
When I search on the forum for "Search" I get 6 pages of results.

All of 30 seconds, probably because I'm familiar with those issues.

I know that OG's search capability is numbingly limited; knowing why makes little difference to my trying to find an IP address in a note, document, calendar event, etc.

It's a shocking design decision that Search won't return a note containing "192", or even the longer string "192.168.0.1".

Number8, normally your many posts are genuinely helpful, so I can understand frustration comes out at times.

Since you say you already knew about the search limitations, then I think a feature request post would be more helpful in this case. I'd be happy to add my support of such a request.
Support OpenGoo - Sponsor a Feature! | Follow me on Twitter | OG Support Chat | Did you turn debugging on?

 

anything