• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to 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

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?
 
Upvote 2
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.
 
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!
 
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.
 
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? :)
 
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.
 
that is important for me. i hope it comes in one of the next releases.
 
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?
 
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.
 
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).
 
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.
 
This is marked "Implemented" and is currently in closed Beta Testing.
 
Back
Top