1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Search by custom fields

Discussion in 'Showcase Closed Suggestions' started by dakis, Jun 9, 2013.

  1. dakis

    dakis New Member Showcase

    I'm trying to setup a search URL based on the custom field's value but it doesn't work.

    I'm trying this:

    Code:
    <a href="http://www.readersociety.gr/index.php?search/&q={$valueUrl}&t=showcase_item&o=date">{$value}</a>
    but it doesn't work, apparently searches create a number before the /&q=

    so i don't know what to put there, I'm sure there must be a way to do this?
     
    ibenick and BK201 like this.
  2. Bob

    Bob Developer Staff Member

    Showcase Item Custom fields are not indexed. Only the message content for the 5 tabs are (plus the title). I've moved this into the suggestions forum as I do plan on adding the indexing of custom fields data to SC Item search in the future.
     
    smartpixels likes this.
  3. dakis

    dakis New Member Showcase

    No wait, when you put the custom field inside the tab, then it works just fine. So when I do the search using the normal search engine, the results come up just fine! The problem is xenforo gives increasing numbers to its searches. so for example a search would be:

    Code:
    readersociety.gr/index.php?search/XX/&q=SEARCHSTRINGHERE&t=showcase_item&o=date
    
    where XX is the increasing number every time (and needs to be a new number for each search)

    So it works and gets results, but the problem is how to replicate the "xx" part on this query above!
     
  4. Bob

    Bob Developer Staff Member

    No, it doesn't work fine. I know what data is indexed and what is not since I wrote the addon and Showcase Custom Fields ARE NOT indexed (Planned, but not yet integrated)

    Here is the code that inserts the DATA into the core search functionality. It is only the BODY (data entered in the Editor) of the 5 tabs and the Title. I have not yet added the ability to insert custom field data.

    PHP:
        protected function _insertIntoIndex(XenForo_Search_Indexer $indexer, array $data, array $parentData null)
        {
            
    $title '';
           
            
    $message $data['message'] . $data['message_t2'] . $data['message_t3'] . $data['message_t4'] . $data['message_t5'];
     
            
    $indexer->insertIntoIndex('showcase_item'$data['item_id'], $data['item_name'], $message$data['date_added'], $data['user_id']);
        }
    Where the custom fields are PLACED to display have nothing to do with the data for those fields being indexed.

    What you are querying with that string is the MESSAGE field built for the index which consists of the data entered via the TinyMCE editor for each of the 5 body fields for the 5 tabs, plus the title of the item.
     
  5. dakis

    dakis New Member Showcase

    Ok I see what you're saying. Damn I was hoping I could include the custom fields in the search :(

    Is there an easy way to do this? If it involved a lot of work can we do it as a paid custom job or something? :)
     
  6. Bob

    Bob Developer Staff Member

    The easy way to do it is not the correct way IMO (which is why I didn't just toss it in to begin with). Easy would be just including the custom fields data in with the "message" bodies, however, that won't let you narrow search down or search just on custom fields which IMO is a major functionality that people will want.

    It is pretty high on the "TODO" list, so it won't be long before the functionality is included.
     
  7. dakis

    dakis New Member Showcase

    Gotcha. Ok thanks for your replies man, I'll wait for that to be added.
     
    Bob likes this.
  8. jörg

    jörg Member AMS Premium SC Premium UBS Premium

    that is important for me. i hope it comes in one of the next releases.
     
  9. Ludachris

    Ludachris Active Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    For some reason I thought custom field searching was going to make it into the 2.0 release... is it still high up on the priority list?
     
  10. Bob

    Bob Developer Staff Member

    Yes, its a high priority suggestion, however, its a complex bit of functionality that takes a lot of R&D and I won't release it until its solid.
     
  11. Bob

    Bob Developer Staff Member

    Working on a prototype of this now. The FIRST version of this is going to be very basic, but at least it will be better than nothing. I will be including the Prototype WITH the addon in an upcoming version. I will make it so that you have to enabled it for users to be able to use (probably a permission).
     
  12. Bob

    Bob Developer Staff Member

    Sneak peek at the working Field Search page.

    Selection_148.png
     
    Last edited: Jul 1, 2014
  13. Bob

    Bob Developer Staff Member

    There are two new options when creating or editing a custom field via Showcase Custom Fields Management in the Admin CP.

    Field is searchable. If enabled, this field will be displayed on the Field Search page allowing members to search for items based on the content of this field.

    Field Search Description. This optional description for text fields will be displayed on the field search page to explain to user what the field contains.

    The reason for this is that some people use Custom Fields for things other than holding view-able content pertaining to the item. This way those types of custom fields can be prevented from being displayed on the advanced search form.
     
  14. Bob

    Bob Developer Staff Member

    This is marked "Implemented" and is currently in closed Beta Testing.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.