Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a "predicate based search"?

I overheard this at a coffee table conversation and i wasnt able to fathom what this was about. A bit of googling didnt throwup anything useful...

Clarification: Thanks guys for the initial take on it... but it appeared that the conversation was about "searching" through databses / internet, etc....

like image 912
Dave Avatar asked Dec 05 '22 02:12

Dave


1 Answers

In general, a predicate is a function that takes one or more arguments, and returns a boolean value, indicating whether some statement about the arguments is true or false.

Examples of natural-language predicates might be "is blue", "is longer than two metres", "is owned by MC Hammer", "is underground".

When executing a search on some system - eg a file system, a database table, a graph - it might be that the system itself provides certain built-in searches (a file system might have a built-in search by filename; a graph might have a built-in search by distance from a given node); or, for more flexibility, there might be a way to search by providing a custom predicate function.

Depending on details, this custom predicate function could be passed as an expression tree, or a pointer to some actual executable code, or a query expression to be parsed. All that is required is that the system has some way to invoke the predicate on each candidate item; and that the predicate returns true or false for each candidate item.

The results of the search are then precisely those items for which the custom predicate returns true.

like image 185
AakashM Avatar answered Mar 06 '23 15:03

AakashM