Is it possible to filter entity lists?

Hello everyone,

i am very new to Elgg development and Elgg itself,  and therefore i am curious if there is a way to filter displayed entities by specific attributes of the given entity (metadata like price, ISBN, or title and description).

Right now i am working with an addon that displays entities (it displays them with the list_entities(...) method), and since the list displayed can get quite big, a filter by content like title, description, price, and so on would be great.

I saw the default Search only searches by tags, so i can not rely on it to filter the content appropriately(or is there a way to tell it to search by customized attributes?)

Does anyone know how i could do a filter plugin or can point me at something to work on with?

Thanks for any replies!

  • I forgot how i did it but to tell you i'm sure this discussion is exist in this forum. you can use the search..

  • will do ... :)


    have found a way to filter them by metadata through this method

    get_entities_from_metadata ($meta_name, $meta_value="", $entity_type="", $entity_subtype="",...);



  • @Adam: goto the following url:

    Top right is an autocomplete search box. It lists all functions available in elgg. Try typing in get_entities and see what comes up.

  • You should also use the more recent implementation of elgg_get_entities_from_metadata()

  • @Adam  what file did you patch-up for you to get it work the search custom entity  hu. but this sample was so awesome ajax autocomplete search. also i'am looking to search a user with autocomplete but has a picture besides it.


    excuse my engllish so horrible. :)

  • @Trajan - Did that, just it's kind of hard looking for something, when you're not exactly sure what it is you are looking for, even if it has autocomplete ;)

    @Matt - something isn't exactly working when i use the new implementation. Is it backwards compatible? If i am not mistaken it was added in 1.8 and we use 1.7.7, so that might be the case why i can't get it to work.

    @caragadatacenter - We're running Elgg 1.7.7 if that's what you meant. If you meant to ask how i got the filtering to work... i made a custom form that lists entities when i enter parameters =) the autocomplete search is amazing yea.. any idea how to do it? prolly would have to customize the search plugin huh?


    PS. Thanks for all the answers people! :)

  • @Adam - elgg_get_entities_from_metadata() was added in 1.7. It requires passing an options array instead of many, many arguments. Check the documentation for details.

    Also, I'm closing this thread because the same question was asked twice and it's confusing. All other replies should go here.

This discussion is closed.

This discussion is closed and is not accepting new comments.