Add fields to searchable fields

Posted By saturation Tue 28 Jun 2011
Rated stars based on 1 vote.
Add to Favorites0
Author Message
saturation
 Posted Tue 28 Jun 2011
Supreme Being

Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)

Group: Forum Members
Last Active: Fri 30 Nov 2012
Posts: 108, Visits: 1,185
Where can I find which fields are searchable from the searchbox?   How can I add another field to that searchable fields?
Mohammad
 Posted Wed 29 Jun 2011
Kartris Expert

Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)

Group: Administrators
Last Active: Sun 27 Sep 2015
Posts: 115, Visits: 706
That is exist in the search stored procedure your website is using, which could be either "spKartrisDB_Search" (default) or "spKartrisDB_SearchFTS" (if you enabled Full Text Search in your database).

By default Kartris searches in the following fields:

1. Version's Name & Description (if you have less than 10,000 versions)
2. Version's Code Number (always)
3. Product's Name & Description (always)
4. Product's Attribute Values (if they are searchable)

Adding new fields to be searchable is a bit tricky and a bit difficult to apply for the 1st time.

In the search stored procedure, line 44 or 42 - depending on how many versions you have:
SET @DataToSearch = '(LE_TypeID IN (1,2,14) AND LE_FieldID IN (1,2))'

1. You need to know the table ID you want, check table 'tblKartrisLanguageElementTypes'
2. You need to know the field ID you want, check table 'tblKartrisLanguageElementFieldNames'
3. There should be a connection (link) between the table and the field, check table 'tblKartrisLanguageElementTypeFields'
4. a) If the needed table and field are exist in the above 2 tables, then just add them to line 44 or 42 in the correct places, near the corresponding IDs, for example if the table id is 'x' and field id is 'y' then the above code could become:
SET @DataToSearch = '(LE_TypeID IN (1,2,14,x) AND LE_FieldID IN (1,2,y))'

   b) If the needed table and field are not exist in the above tables, then you need to study the search stored procedure and add your (dynamic) SQL it in the correct place, if you had any problems or difficulties, just let me know which table/field you want to add and will give you hands on this.
saturation
 Posted Fri 1 Jul 2011
Supreme Being

Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)

Group: Forum Members
Last Active: Fri 30 Nov 2012
Posts: 108, Visits: 1,185
Thank you!   That worked perfect!
saturation
 Posted Fri 1 Jul 2011
Supreme Being

Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)Supreme Being - (57,426 reputation)

Group: Forum Members
Last Active: Fri 30 Nov 2012
Posts: 108, Visits: 1,185
Ok, one more thing.   I then tried adding the category name (table 3, field 1), so now my search variables look like

    IF @NoOfVersions > 10000 BEGIN
        SET @DataToSearch = '(LE_TypeID IN (2,14,3) AND LE_FieldID IN (1,2,7))'
    END ELSE BEGIN
        SET @DataToSearch = '(LE_TypeID IN (1,2,3,14) AND LE_FieldID IN (1,2,7))'
    END

The search results count is correct, but it returns nothing because there are no products or versions specifically with the category name in it.   Is there any way to get all products and/or versions returned if someone types in a category name?
Mohammad
 Posted Fri 1 Jul 2011
Kartris Expert

Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)Kartris Expert - (70,163 reputation)

Group: Administrators
Last Active: Sun 27 Sep 2015
Posts: 115, Visits: 706
In this case, you need to write your own code to handle that, the existing search doesn't return the products/versions under a searched category, simply because the categories could be easily navigated.

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top