From: Demian K. <dem...@vi...> - 2014-01-08 14:03:59
|
The default advanced search behavior should already allow two levels of Boolean operation - there's a top-level operator that is applied to the groups, and a group-level operator applied to the queries within the group. VuFind tries to conceal the Boolean nature of the functionality with more user-oriented language, but basically you construct queries of the form: (q1 OPERATOR q2 OPERATOR q3 OPERATOR ...) OPERATOR (q4 OPERATOR q5 OPERATOR q6 ...) ... ...if that makes any sense. The object is translated into the query through the QueryBuilder class within the backend. You can see some examples in the other VuFindSearch\Backend\*\QueryBuilder classes. If you need to make more extensive changes to the search model, let me know - I've been working with some Primo Central users to build a module for that discovery layer as well, and they need significantly different advanced search behavior; I was able to implement it fairly easily and that code might be useful for reference as well. You can find it in the primocentral branch of the main VuFind repo - still work in progress: https://github.com/vufind-org/vufind/tree/primocentral - Demian From: Michelle Suranofsky [mailto:mi...@le...] Sent: Wednesday, January 08, 2014 8:44 AM To: vuf...@li... Subject: Re: [VuFind-Tech] question: multiple operators in QueryGroup Maybe I should clarify my question... I know how to change the class (to make operator a collection) -- but where do I have to make other changes in the code to deal with this change? How is the object translated into the query? I imagine I'll have to make changes there? thanks again! On Tue, Jan 7, 2014 at 2:16 PM, Michelle Suranofsky <mi...@le...<mailto:mi...@le...>> wrote: Hello, I would like to and/or/not the queries within a QueryGroup. At this time it looks like it has just one operator. Some of the files I'm looking at are: VuFindSearch\Query\QueryGroup.php VuFind\Search\QueryAdapter Any information about is appreciated!! thank you! Michelle |