4images Modifications / Modifikationen > Tutorials

[Tutorial] Making additional field searchable

<< < (4/15) > >>

titi-fr:
here the sample of my rebuilt :


--- Code: ---Processing image Villa Traditionnelle RUY – 2 min. A 43 - 338 000 €, ID 3 ...
DB Error: Bad SQL Query: REPLACE INTO 4images_wordmatch (image_id, word_id, name_match, desc_match, keys_match, prix_match) VALUES (3, 181, 1, 1, 0), (3, 1204, 1, 1, 0), (3, 183, 1, 0, 0), (3, 184, 1, 0, 0), (3, 1205, 1, 1, 0), (3, 21, 1, 1, 0), (3, 18, 0, 1, 0), (3, 1206, 0, 1, 0), (3, 22, 0, 1, 0), (3, 23, 0, 1, 0), (3, 1022, 0, 1, 0), (3, 188, 0, 1, 0), (3, 189, 0, 1, 0), (3, 1023, 0, 1, 0), (3, 191, 0, 1, 0), (3, 1207, 0, 1, 0), (3, 27, 0, 1, 0), (3, 1208, 0, 1, 0), (3, 778, 0, 1, 0), (3, 35, 0, 1, 0), (3, 195, 0, 1, 0), (3, 196, 0, 1, 0), (3, 1209, 0, 1, 0), (3, 36, 0, 1, 0), (3, 198, 0, 1, 0), (3, 40, 0, 1, 0), (3, 1210, 0, 1, 0), (3, 1211, 0, 1, 0), (3, 1212, 0, 1, 0), (3, 11, 0, 1, 0), (3, 202, 0, 1, 0), (3, 203, 0, 1, 0), (3, 204, 0, 1, 0), (3, 1030, 0, 1, 0), (3, 1213, 0, 1, 0), (3, 1214, 0, 1, 0), (3, 1215, 0, 1, 0), (3, 688, 0, 0, 1)
Column count doesn't match value count at row 1
OK
Processing image Ferme rénovée la verpillière 327 000 €, ID 2 ...
DB Error: Bad SQL Query: REPLACE INTO 4images_wordmatch (image_id, word_id, name_match, desc_match, keys_match, prix_match) VALUES (2, 151, 1, 1, 0), (2, 152, 1, 0, 0), (2, 724, 1, 0, 0), (2, 725, 1, 1, 0), (2, 21, 1, 1, 0), (2, 17, 0, 1, 0), (2, 18, 0, 1, 0), (2, 726, 0, 1, 0), (2, 22, 0, 1, 0), (2, 23, 0, 1, 0), (2, 727, 0, 1, 0), (2, 728, 0, 1, 0), (2, 158, 0, 1, 0), (2, 27, 0, 1, 0), (2, 729, 0, 1, 0), (2, 730, 0, 1, 0), (2, 731, 0, 1, 0), (2, 732, 0, 1, 0), (2, 733, 0, 1, 0), (2, 33, 0, 1, 0), (2, 734, 0, 1, 0), (2, 35, 0, 1, 0), (2, 36, 0, 1, 0), (2, 37, 0, 1, 0), (2, 163, 0, 1, 0), (2, 164, 0, 1, 0), (2, 40, 0, 1, 0), (2, 41, 0, 1, 0), (2, 42, 0, 1, 0), (2, 11, 0, 1, 0), (2, 165, 0, 1, 0), (2, 735, 0, 1, 0), (2, 167, 0, 1, 0), (2, 736, 0, 1, 0), (2, 688, 0, 0, 1)
Column count doesn't match value count at row 1

--- End code ---

i've added 3 fields in images wordmatch :x but only "prix" appeared...

V@no:
on some servers u can not use non-latin letters...its a server side configuration (mysql)

titi-fr:
u mean like that: é à etc ?

th fields who doesnt appears are name reference & code, not non-latin

TIMT:
I don't know why... but it doesn't work..   :(

I have implemented two additionales files: user_vorname and user_name2.

I have entered the two fields name2_match and vorname_match in the table 4images_wordmatch in my database

In search_utils.php I have entered the following code:

--- Code: ---$search_match_fields = array(
  "image_name" => "name_match",
  "image_description" => "desc_match",
  "image_keywords" => "keys_match",
  "user_vorname" => "vorname_match",
  "user_name2" => "name2_match"
--- End code ---

In main.php I have entered the following code:

--- Code: ---$lang['user_name2_only'] = "Nur Name";
$lang['user_vorname_only'] = "Nur Vorname";

--- End code ---

In search_form.html I have entered the following code:

--- Code: ---<tr>
                  <td nowrap="nowrap" class="td2"><input type="radio" name="search_fields" value="user_vorname" /> {lang_user_vorname_only}</td>
                  <td nowrap="nowrap">&nbsp;</td>
                  <td nowrap="nowrap" class="td2"><input type="radio" name="search_fields" value="user_name2" /> {lang_user_name2_only}</td>               
                </tr>

--- End code ---

Than I rebuilded the search index.

On the search-sreen I can see the new radio buttons, but not the description of the radio buttons (regarding the entry in main.php).
The search of "user_name2" or "user_vorname" doesn't work.

Where is the problem?

Thank you for helping me!
Serge

V@no:
1) make sure u've updated includes/db_fields_definitions.php
2) the search_form is wrong, it should be in this format:
--- Code: ---              <input type="radio" name="user_vorname" value="1"{user_vorname_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_vorname" value="0"{user_vorname_no} />
              {lang_no}
--- End code ---
But its hard to tell what exactly are u planning to do...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version