After investigating for hours, I realized that there was a problem with some areas of Search API Index creation.

I noticed that the tables were inappropriately getting created. I suppose there is a max length for the table name that can exists in the DB.

Following is one such example.

Field - field_print_product_variation:commerce_price:amount_decimal
Table name (generated by search api)
search_api_db_print_server_field_print_product_variation_commer

There were many such problems with the length of table.

Could anyone possibly help me with this. It is very urgent.

Comments

drunken monkey’s picture

Category: bug » support
Priority: Critical » Normal

Problems that are urgent for you aren't automatically "critical". Please follow the guidelines for Priority.

That being said: what is the problem here? The table names will be truncated since DBMSs impose a restriction on the length of identifiers – however, even though the table names look wrong, everything should still work perfectly fine. Or have you experienced any real issues?

drunken monkey’s picture

Project: Search API » Search API Database Search
Component: Framework » Code
vishy_singhal’s picture

Apologies for marking it as Critical.

Yes, None of my tables are getting populated. Only the ones which have complete names are getting populated.

drunken monkey’s picture

Oh, OK … Are you using the latest version of this module, and of the Search API?
Have you tried moving the index from the server and then again to it? Does the same bug occur?
If nothing else helps: can you output the server's options and post them here? (In case you are no programmer: install Devel, go to devel/php and enter print_r(search_api_server_load("YOUR SERVER'S MACHINE NAME")->options);.)

vishy_singhal’s picture

@Drunken_monkey :

Yes, I am using the latest version of Search API

Here you go -

[database] => default:default
    [min_chars] => 1
    [indexes] => Array
        (
            [product_display] => Array
                (
                    [type] => Array
                        (
                            [table] => search_api_db_product_display_type
                            [type] => string
                            [boost] => 1.0
                        )

                    [title_field] => Array
                        (
                            [table] => search_api_db_product_display_title_field
                            [type] => string
                            [boost] => 1.0
                        )

                    [field_product] => Array
                        (
                            [table] => search_api_db_product_display_field_product
                            [type] => list
                            [boost] => 1.0
                        )

                    [search_api_language] => Array
                        (
                            [table] => search_api_db_product_display_search_api_language
                            [type] => string
                            [boost] => 1.0
                        )

                    [field_product_commerce_price_amount_decimal_asc] => Array
                        (
                            [table] => search_api_db_product_display_field_product_commerce_price_amou
                            [type] => decimal
                            [boost] => 1.0
                        )

                    [field_product_commerce_price_amount_decimal_desc] => Array
                        (
                            [table] => search_api_db_product_display_field_product_commerce_price_am_1
                            [type] => decimal
                            [boost] => 1.0
                        )

                    [field_product:commerce_price:amount_decimal] => Array
                        (
                            [table] => search_api_db_product_display_field_product_commerce_price_am_2
                            [type] => list
                            [boost] => 1.0
                        )

                    [field_product:field_print_size] => Array
                        (
                            [table] => search_api_db_product_display_field_product_field_print_size
                            [type] => list
                            [boost] => 1.0
                        )

                    [field_product:field_artwork_type] => Array
                        (
                            [table] => search_api_db_product_display_field_product_field_artwork_type
                            [type] => list
                            [boost] => 1.0
                        )

                    [field_product:field_artwork_type:name] => Array
                        (
                            [table] => search_api_db_product_display_field_product_field_artwork_type_
                            [type] => list
                            [boost] => 1.0
                        )

                    [field_artwork_subject] => Array
                        (
                            [table] => search_api_db_product_display_field_artwork_subject
                            [type] => integer
                            [boost] => 1.0
                        )

                    [field_product:field_edition] => Array
                        (
                            [table] => search_api_db_product_display_field_product_field_edition
                            [type] => list
                            [boost] => 1.0
                        )

                    [field_artwork_subject:name] => Array
                        (
                            [table] => search_api_db_product_display_field_artwork_subject_name
                            [type] => string
                            [boost] => 1.0
                        )

                    [field_traditional_art_type:name] => Array
                        (
                            [table] => search_api_db_product_display_field_traditional_art_type_name
                            [type] => string
                            [boost] => 1.0
                        )

                    [field_product:field_edition:name] => Array
                        (
                            [table] => search_api_db_product_display_field_product_field_edition_name
                            [type] => list
                            [boost] => 1.0
                        )

                    [field_sculpture_type] => Array
                        (
                            [table] => search_api_db_product_display_field_sculpture_type
                            [type] => integer
                            [boost] => 1.0
                        )

                    [field_gallery_type] => Array
                        (
                            [table] => search_api_db_product_display_field_gallery_type
                            [type] => integer
                            [boost] => 1.0
                        )

                    [field_sculpture_type:name] => Array
                        (
                            [table] => search_api_db_product_display_field_sculpture_type_name
                            [type] => string
                            [boost] => 1.0
                        )

                    [field_gallery_type:name] => Array
                        (
                            [table] => search_api_db_product_display_field_gallery_type_name
                            [type] => string
                            [boost] => 1.0
                        )

                    [title] => Array
                        (
                            [table] => search_api_db_product_display_title
                            [type] => text
                            [boost] => 1.0
                        )

                    [field_artwork_gallery] => Array
                        (
                            [table] => search_api_db_product_display_field_artwork_gallery
                            [type] => integer
                            [boost] => 1.0
                        )

                    [field_primary_color] => Array
                        (
                            [table] => search_api_db_product_display_field_primary_color
                            [type] => integer
                            [boost] => 1.0
                        )

                    [field_artist] => Array
                        (
                            [table] => search_api_db_product_display_field_artist
                            [type] => text
                            [boost] => 1.0
                        )

                    [field_product:status] => Array
                        (
                            [table] => search_api_db_product_display_field_product_status
                            [type] => list
                            [boost] => 1.0
                        )

                    [status] => Array
                        (
                            [table] => search_api_db_product_display_status
                            [type] => string
                            [boost] => 1.0
                        )

                    [created] => Array
                        (
                            [table] => search_api_db_product_display_created
                            [type] => date
                            [boost] => 1.0
                        )

                    [field_category] => Array
                        (
                            [table] => search_api_db_product_display_field_category
                            [type] => integer
                            [boost] => 1.0
                        )

                    [field_product:field_brand] => Array
                        (
                            [table] => search_api_db_product_display_field_product_field_brand
                            [type] => list
                            [boost] => 1.0
                        )

                    [field_category:name] => Array
                        (
                            [table] => search_api_db_product_display_field_category_name
                            [type] => text
                            [boost] => 1.0
                        )

                    [field_product:field_brand:name] => Array
                        (
                            [table] => search_api_db_product_display_field_product_field_brand_name
                            [type] => list
                            [boost] => 1.0
                        )

                )



            [print_server] => Array
                (
                    [type] => Array
                        (
                            [table] => search_api_db_print_server_type
                            [type] => string
                            [boost] => 1.0
                        )

                    [title] => Array
                        (
                            [table] => search_api_db_print_server_title
                            [type] => text
                            [boost] => 1.0
                        )

                    [created] => Array
                        (
                            [table] => search_api_db_print_server_created
                            [type] => date
                            [boost] => 1.0
                        )

                    [title_field] => Array
                        (
                            [table] => search_api_db_print_server_title_field
                            [type] => text
                            [boost] => 1.0
                        )

                    [field_artist] => Array
                        (
                            [table] => search_api_db_print_server_field_artist
                            [type] => text
                            [boost] => 1.0
                        )

                    [search_api_language] => Array
                        (
                            [table] => search_api_db_print_server_search_api_language
                            [type] => string
                            [boost] => 1.0
                        )

                    [field_print_product_variation:type] => Array
                        (
                            [table] => search_api_db_print_server_field_print_product_variation_type
                            [type] => string
                            [boost] => 1.0
                        )

                    [field_print_product_variation:title] => Array
                        (
                            [table] => search_api_db_print_server_field_print_product_variation_title
                            [type] => text
                            [boost] => 1.0
                        )

                    [field_print_product_variation:status] => Array
                        (
                            [table] => search_api_db_print_server_field_print_product_variation_status
                            [type] => boolean
                            [boost] => 1.0
                        )

                    [field_print_product_variation:field_print_size] => Array
                        (
                            [table] => search_api_db_print_server_field_print_product_variation_field_
                            [type] => integer
                            [boost] => 1.0
                        )

                    [field_print_product_variation:field_edition] => Array
                        (
                            [table] => search_api_db_print_server_field_print_product_variation_fiel_2
                            [type] => integer
                            [boost] => 1.0
                        )

                    [field_print_product_variation:commerce_price:amount_decimal] => Array
                        (
                            [table] => search_api_db_print_server_field_print_product_variation_commer
                            [type] => decimal
                            [boost] => 1.0
                        )

                    [field_print_product_variation:commerce_stock] => Array
                        (
                            [table] => search_api_db_print_server_field_print_product_variation_comm_1
                            [type] => decimal
                            [boost] => 1.0
                        )

                )

        )

)

drunken monkey’s picture

Thanks!
While the shortened table names seem to be correctly saved in the options (so no error should occur), I wonder why the table names are truncated to 63 bytes, not the 62 we are using. Are you positive you are using the latest release of the Database Search module (1.0, but RC 2 or 3 should be fine, too – as is a recent dev release, of course)?
If so, did you try removing the index from the server and then back on it?

vishy_singhal’s picture

@drunken monkey

Yes, I am pretty sure about using the latest version of Search API - Just crossed checked too.

In addition, I did remove the index from the server and then moved it back but without any luck.

drunken monkey’s picture

The Database Search module, not Search API itself.
Is it possible you're not using that, but still the years old version that was at some point included in the Search API?

lsolesen’s picture

Issue summary: View changes
Status: Active » Fixed

Closing old issues. Please reopen if this is still an issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.