Author Topic: Search string for mutiple fields  (Read 2761 times)

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Search string for mutiple fields
« on: June 19, 2018, 02:07:56 AM »
Is it possible to craft a search string for fe.overlay.search_string that looks into more fields at the same time?

Right now the syntax I know is something like "Field contains regexp" where "Field" can be Title, Year, Manufacturer etc, while regexp is the text to find (but also allows some regexp tricks like [] to insert multiple letters etc). I don't know if it's possible to apply a search string that looks in title or manufacturer or year or category. Something like "Title contains regexp || Manufacturer contains regexp" etc

Is it even possible?

The way I would use it is not to create refined searches but just to look for the same user-input text in ALL meaningful fields. So that if I put 198 in search I'll end with all the games done in the 80's, or if I put Toaplan I get all the games made by toaplan, without having to chose beforehand what field to apply the search.
« Last Edit: June 19, 2018, 02:11:03 AM by zpaolo11x »

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1271
    • View Profile
Re: Search string for mutiple fields
« Reply #1 on: June 19, 2018, 10:33:58 PM »
Are you talking about filters/tags or one of the search plugin/module features?

The type of things you describe are usually done by most people with filters and/or tags. Once these filters or tags are in place you can further refine their results with a search plugin/module with the game name.

To directly answer your question, yes it's possible in a plugin/module. It would increase search times and might deliver results that wouldn't make sense to a lot of people. I'm not saying this concept is bad but I think others have managed this in another way.

P.S. See if this might help http://forum.attractmode.org/index.php?topic=2297.0 I used to have a full write up here http://forum.attractmode.org/index.php?topic=1165.0 but it seems to be gone.
« Last Edit: June 19, 2018, 10:54:45 PM by progets »

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Search string for mutiple fields
« Reply #2 on: June 19, 2018, 11:30:05 PM »
Are you talking about filters/tags or one of the search plugin/module features?

I'm not talking about filters, filters are great but they are created "outside" of the AM layout you are using and I wanted something to be used without getting to the AM menus. Basically I'm talking about search features in the AM layout that are poorly documented in the main guide. Search plugins and modules all use fe.list.search_string but the documentation is very limited.

Quote
P.S. See if this might help http://forum.attractmode.org/index.php?topic=2297.0 I used to have a full write up here http://forum.attractmode.org/index.php?topic=1165.0 but it seems to be gone.

I gave a look at that but I don't think it's exactly what I need... consider the scenario of the "search plugin" for example: you can use it to search for Title, but not to search for Manufacturer for example. In my layout I created a menu to choose where you want to search, so let's say you push the "Search" button, a menu asks you if you want to look for title, or manufacturer etc and then you enter the string and get the result. It would be much smoother if you could just enter the string and let the search run on many fields but I can't get how to code it. Of course you'll have some "inconsistent" results for example you might get hits for both title and genre mixed together, but it's what usually happens in media front-ends when you look for something and it lists both movies that have that word in the title, or in the description, or in the cast etc.