MARCsearch($dbh,@searcharray). @searcharray contains an array with the search string (coding smthg like ””). searchable fields are defined in MARC parameter table. possible operators are =, <>, >, <, sounds soundsnot. the functions builds an array of biblios corresponding to the search string by doing atomic search (ie : builds list of biblio having author='victor', a list of biblios having 'hugo', AND-ing both, building a list of biblios having title='miserables', OR-ing the list with the previous one… how do we know which biblios have author='victor' ? simple :
(note we drop 'les', it's a stopword in french ).
Note : this algorythm may build HUGE arrays, if we do something like “author <> 'victor'”. It can be better with adding “bibid in (allreadyselectedbibid1,allreadyselectedbibid2…)” in the SQL statement.
MARCgetbiblio($dbh,$bibid), sub that returns a MARC::Record for a bibid already exists in Biblio.pm. Mix MARCsearch and MARCgetbiblio, and you've got what we need
Note we use the table marc_word for searches. should be quite hard to code but VERY FAST, as we should have only indexed searches (nothing like “value like %x%”, which is a pain, as not indexed).