Magento 2.2.5: How Cms Page Search Work? The Next CEO of Stack OverflowHow does Magento 2 Search work with '-'?Magento 2.1: Not add table into databaseMagento 2 : How to Fetch CMS Page Content Using SearchMagento 2 Add new field to Magento_User admin formI have created an extension to show Customer Company Name in Order grid. But when creating new order, order is not showing in order gridMagento 2.2.5: Search Wish ListMagento 2.2.5 Product attribute “use in search” RESETTING after index:reindexMagento 2.2.5: How Search In Category Product Work?Magento 2.2.5: About Search FullTextMagento 2.2.5 Fatal Error in Category and Search Page

Visit to the USA with ESTA approved before trip to Iran

Whats the best way to handle refactoring a big file?

How to count occurrences of text in a file?

How did people program for Consoles with multiple CPUs?

Why does C# sound extremely flat when saxophone is tuned to G?

WOW air has ceased operation, can I get my tickets refunded?

Customer Requests (Sometimes) Drive Me Bonkers!

Need some help with wall behind rangetop

% symbol leads to superlong (forever?) compilations

Trouble understanding the speech of overseas colleagues

Why doesn't a table tennis ball float on the surface? How do we calculate buoyancy here?

Go Pregnant or Go Home

Why does standard notation not preserve intervals (visually)

Robert Sheckley short story about vacation spots being overwhelmed

How to write the block matrix in LaTex?

Opposite of a diet

India just shot down a satellite from the ground. At what altitude range is the resulting debris field?

How can I open an app using Terminal?

Why did we only see the N-1 starfighters in one film?

What is the difference between "behavior" and "behaviour"?

How to be diplomatic in refusing to write code that breaches the privacy of our users

Fastest way to shutdown Ubuntu Mate 18.10

What is the point of a new vote on May's deal when the indicative votes suggest she will not win?

Inappropriate reference requests from Journal reviewers



Magento 2.2.5: How Cms Page Search Work?



The Next CEO of Stack OverflowHow does Magento 2 Search work with '-'?Magento 2.1: Not add table into databaseMagento 2 : How to Fetch CMS Page Content Using SearchMagento 2 Add new field to Magento_User admin formI have created an extension to show Customer Company Name in Order grid. But when creating new order, order is not showing in order gridMagento 2.2.5: Search Wish ListMagento 2.2.5 Product attribute “use in search” RESETTING after index:reindexMagento 2.2.5: How Search In Category Product Work?Magento 2.2.5: About Search FullTextMagento 2.2.5 Fatal Error in Category and Search Page










0















Like i said in the title, i dont know how the Search in Catalog work.



As far as i know, the Search is render through this code in this ui-component:



C:xampphtdocsmagentovendormagentomodule-cmsviewadminhtmlui_componentcms_page_listing.xml

<filterSearch name="fulltext"/>


And when i copy this code and paste to my ui-component, it doesn't work at all, i can render the search text box, but when i write something and push "Enter", nothing happened.



enter image description here



EDIT 1:



(Here is my ui-component, InstallSchema and UpgradeSchema file)



File : C:xampphtdocsmagentoappcodeAhtBannerSliderviewadminhtmlui_componentbanner_form.xml



<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">banner_form.banner_form_data_source</item>
</item>
<item name="label" xsi:type="string" translate="true">General Information</item>
<item name="template" xsi:type="string">templates/form/collapsible</item>
</argument>
<settings>
<buttons>
<button name="save_and_continue" class="AhtBannerSliderBlockAdminhtmlBannerEditSaveAndContinueButton"/>
<button name="save" class="AhtBannerSliderBlockAdminhtmlBannerEditSaveButton"/>
<button name="reset" class="AhtBannerSliderBlockAdminhtmlBannerEditResetButton"/>
<button name="delete" class="AhtBannerSliderBlockAdminhtmlBannerEditDeleteButton"/>
<button name="back" class="AhtBannerSliderBlockAdminhtmlBannerEditBackButton"/>
</buttons>
<namespace>banner_form</namespace>
<dataScope>data</dataScope>
<deps>
<dep>banner_form.banner_form_data_source</dep>
</deps>
</settings>
<dataSource name="banner_form_data_source">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
</item>
</argument>
<settings>
<submitUrl path="banner/manage/save"/>
</settings>
<dataProvider class="AhtBannerSliderModelBannerDataProvider" name="banner_form_data_source">
<settings>
<requestFieldName>id</requestFieldName>
<primaryFieldName>id</primaryFieldName>
</settings>
</dataProvider>
</dataSource>
<fieldset name="general">
<settings>
<label/>
</settings>
<field name="id" formElement="input">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">banner</item>
</item>
</argument>
<settings>
<dataType>text</dataType>
<visible>false</visible>
<dataScope>id</dataScope>
</settings>
</field>
<field name="name" sortOrder="20" formElement="input">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">banner</item>
</item>
</argument>
<settings>
<validation>
<rule name="required-entry" xsi:type="boolean">true</rule>
</validation>
<dataType>text</dataType>
<label translate="true">Banner Name</label>
<dataScope>name</dataScope>
</settings>
</field>
</fieldset>
</form>


File: InstallSchema.php



class InstallSchema implements MagentoFrameworkSetupInstallSchemaInterface


public function install(MagentoFrameworkSetupSchemaSetupInterface $setup, MagentoFrameworkSetupModuleContextInterface $context)

$installer = $setup;
$installer->startSetup();
if (!$installer->tableExists('banner'))
$table = $installer->getConnection()->newTable(
$installer->getTable('banner')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'name',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
['nullable => false'],
'Name'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Banner Table');
$installer->getConnection()->createTable($table);


if (!$installer->tableExists('slide'))
$table = $installer->getConnection()->newTable(
$installer->getTable('slide')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'banner_id',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
[],
'Banner Id'
)
->addColumn(
'name',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
['nullable => false'],
'Name'
)
->addColumn(
'url',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
[],
'URL'
)
->addColumn(
'image',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
[],
'Image'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Slide Table');
$installer->getConnection()->createTable($table);


$installer->endSetup();






File: UpgradeSchema.php



<?php
namespace AhtBannerSliderSetup;

use MagentoFrameworkSetupUpgradeSchemaInterface;
use MagentoFrameworkSetupSchemaSetupInterface;
use MagentoFrameworkSetupModuleContextInterface;

class UpgradeSchema implements UpgradeSchemaInterface

public function upgrade( SchemaSetupInterface $setup, ModuleContextInterface $context )
$installer = $setup;

$installer->startSetup();

if(version_compare($context->getVersion(), '1.1.0', '<'))

if (!$installer->tableExists('banner_slide'))
$table = $installer->getConnection()->newTable(
$installer->getTable('banner_slide')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'banner_id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
['nullable => false'],
'Banner ID'
)
->addColumn(
'slide_id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
['nullable => false'],
'Slide ID'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Banner Slide Table');

$installer->getConnection()->createTable($table);


if (!$installer->tableExists('banner_page'))
$table = $installer->getConnection()->newTable(
$installer->getTable('banner_page')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'banner_id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
['nullable => false'],
'Banner ID'
)
->addColumn(
'page_url',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
['nullable => false'],
'Page Url'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Banner Page Table');

$installer->getConnection()->createTable($table);


if ($installer->tableExists('slide'))
$connection = $installer->getConnection();
$tableName = $installer->getTable('slide');
$columnName = 'banner_id';
if($connection->tableColumnExists($tableName,$columnName, $schemaName = null))
$connection->dropColumn($tableName, $columnName, $schemaName = null);




$installer->endSetup();




EDIT 2 (fixed in EDIT 3):



I'm following Marius solution.



But it doesn't seem to work. It throw an error when i'm trying "php bin/magento setup:upgrade"



Installing schema... Upgrading schema... SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.banner_name' doesn't exist, query was: DESCRIBE BANNER_NAME



So here is what i update to UpdateSchema.php.



if ($installer->tableExists('banner'))
$connection = $installer->getConnection();
$connection->addIndex(
$setup->getIdxName(
$installer->getTable('banner'),
['name'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['name'],
['type' => AdapterInterface::INDEX_TYPE_FULLTEXT]
);



EDIT 3:



So i was trying Marius solution like this (the difference is i give it a table in "addIndex" function):



if ($installer->tableExists('banner'))
$connection = $installer->getConnection();
$connection->addIndex(
$installer->getTable('banner'),
$setup->getIdxName(
$installer->getTable('banner'),
['name'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['name'],
AdapterInterface::INDEX_TYPE_FULLTEXT
);



Also, before i do that, i have to clear cache and delete my module in "setup_module" table, and it work. But for some reason, when i click "x" to clear the search, it throw 2 column exactly like the same( look the image below):
enter image description here



1 more problem is i cant search with "c". I've read some where that "fulltext_search" cant be use with 5 or less character. So there are any solution to fix this?










share|improve this question
























  • In which module it's not working?

    – Suresh Chikani
    Aug 1 '18 at 7:35











  • Thanks for reply, i'm trying to do the search, so the one is not working is my module. I'll edit the post so you can see my ui-component. :)

    – fudu
    Aug 1 '18 at 7:47











  • Edited, please check :D

    – fudu
    Aug 1 '18 at 7:49











  • can you post your InstallSchema.php file in here ?

    – Marius
    Aug 1 '18 at 7:52











  • Ok, hold on, i'm editing

    – fudu
    Aug 1 '18 at 7:56















0















Like i said in the title, i dont know how the Search in Catalog work.



As far as i know, the Search is render through this code in this ui-component:



C:xampphtdocsmagentovendormagentomodule-cmsviewadminhtmlui_componentcms_page_listing.xml

<filterSearch name="fulltext"/>


And when i copy this code and paste to my ui-component, it doesn't work at all, i can render the search text box, but when i write something and push "Enter", nothing happened.



enter image description here



EDIT 1:



(Here is my ui-component, InstallSchema and UpgradeSchema file)



File : C:xampphtdocsmagentoappcodeAhtBannerSliderviewadminhtmlui_componentbanner_form.xml



<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">banner_form.banner_form_data_source</item>
</item>
<item name="label" xsi:type="string" translate="true">General Information</item>
<item name="template" xsi:type="string">templates/form/collapsible</item>
</argument>
<settings>
<buttons>
<button name="save_and_continue" class="AhtBannerSliderBlockAdminhtmlBannerEditSaveAndContinueButton"/>
<button name="save" class="AhtBannerSliderBlockAdminhtmlBannerEditSaveButton"/>
<button name="reset" class="AhtBannerSliderBlockAdminhtmlBannerEditResetButton"/>
<button name="delete" class="AhtBannerSliderBlockAdminhtmlBannerEditDeleteButton"/>
<button name="back" class="AhtBannerSliderBlockAdminhtmlBannerEditBackButton"/>
</buttons>
<namespace>banner_form</namespace>
<dataScope>data</dataScope>
<deps>
<dep>banner_form.banner_form_data_source</dep>
</deps>
</settings>
<dataSource name="banner_form_data_source">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
</item>
</argument>
<settings>
<submitUrl path="banner/manage/save"/>
</settings>
<dataProvider class="AhtBannerSliderModelBannerDataProvider" name="banner_form_data_source">
<settings>
<requestFieldName>id</requestFieldName>
<primaryFieldName>id</primaryFieldName>
</settings>
</dataProvider>
</dataSource>
<fieldset name="general">
<settings>
<label/>
</settings>
<field name="id" formElement="input">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">banner</item>
</item>
</argument>
<settings>
<dataType>text</dataType>
<visible>false</visible>
<dataScope>id</dataScope>
</settings>
</field>
<field name="name" sortOrder="20" formElement="input">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">banner</item>
</item>
</argument>
<settings>
<validation>
<rule name="required-entry" xsi:type="boolean">true</rule>
</validation>
<dataType>text</dataType>
<label translate="true">Banner Name</label>
<dataScope>name</dataScope>
</settings>
</field>
</fieldset>
</form>


File: InstallSchema.php



class InstallSchema implements MagentoFrameworkSetupInstallSchemaInterface


public function install(MagentoFrameworkSetupSchemaSetupInterface $setup, MagentoFrameworkSetupModuleContextInterface $context)

$installer = $setup;
$installer->startSetup();
if (!$installer->tableExists('banner'))
$table = $installer->getConnection()->newTable(
$installer->getTable('banner')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'name',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
['nullable => false'],
'Name'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Banner Table');
$installer->getConnection()->createTable($table);


if (!$installer->tableExists('slide'))
$table = $installer->getConnection()->newTable(
$installer->getTable('slide')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'banner_id',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
[],
'Banner Id'
)
->addColumn(
'name',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
['nullable => false'],
'Name'
)
->addColumn(
'url',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
[],
'URL'
)
->addColumn(
'image',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
[],
'Image'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Slide Table');
$installer->getConnection()->createTable($table);


$installer->endSetup();






File: UpgradeSchema.php



<?php
namespace AhtBannerSliderSetup;

use MagentoFrameworkSetupUpgradeSchemaInterface;
use MagentoFrameworkSetupSchemaSetupInterface;
use MagentoFrameworkSetupModuleContextInterface;

class UpgradeSchema implements UpgradeSchemaInterface

public function upgrade( SchemaSetupInterface $setup, ModuleContextInterface $context )
$installer = $setup;

$installer->startSetup();

if(version_compare($context->getVersion(), '1.1.0', '<'))

if (!$installer->tableExists('banner_slide'))
$table = $installer->getConnection()->newTable(
$installer->getTable('banner_slide')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'banner_id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
['nullable => false'],
'Banner ID'
)
->addColumn(
'slide_id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
['nullable => false'],
'Slide ID'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Banner Slide Table');

$installer->getConnection()->createTable($table);


if (!$installer->tableExists('banner_page'))
$table = $installer->getConnection()->newTable(
$installer->getTable('banner_page')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'banner_id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
['nullable => false'],
'Banner ID'
)
->addColumn(
'page_url',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
['nullable => false'],
'Page Url'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Banner Page Table');

$installer->getConnection()->createTable($table);


if ($installer->tableExists('slide'))
$connection = $installer->getConnection();
$tableName = $installer->getTable('slide');
$columnName = 'banner_id';
if($connection->tableColumnExists($tableName,$columnName, $schemaName = null))
$connection->dropColumn($tableName, $columnName, $schemaName = null);




$installer->endSetup();




EDIT 2 (fixed in EDIT 3):



I'm following Marius solution.



But it doesn't seem to work. It throw an error when i'm trying "php bin/magento setup:upgrade"



Installing schema... Upgrading schema... SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.banner_name' doesn't exist, query was: DESCRIBE BANNER_NAME



So here is what i update to UpdateSchema.php.



if ($installer->tableExists('banner'))
$connection = $installer->getConnection();
$connection->addIndex(
$setup->getIdxName(
$installer->getTable('banner'),
['name'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['name'],
['type' => AdapterInterface::INDEX_TYPE_FULLTEXT]
);



EDIT 3:



So i was trying Marius solution like this (the difference is i give it a table in "addIndex" function):



if ($installer->tableExists('banner'))
$connection = $installer->getConnection();
$connection->addIndex(
$installer->getTable('banner'),
$setup->getIdxName(
$installer->getTable('banner'),
['name'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['name'],
AdapterInterface::INDEX_TYPE_FULLTEXT
);



Also, before i do that, i have to clear cache and delete my module in "setup_module" table, and it work. But for some reason, when i click "x" to clear the search, it throw 2 column exactly like the same( look the image below):
enter image description here



1 more problem is i cant search with "c". I've read some where that "fulltext_search" cant be use with 5 or less character. So there are any solution to fix this?










share|improve this question
























  • In which module it's not working?

    – Suresh Chikani
    Aug 1 '18 at 7:35











  • Thanks for reply, i'm trying to do the search, so the one is not working is my module. I'll edit the post so you can see my ui-component. :)

    – fudu
    Aug 1 '18 at 7:47











  • Edited, please check :D

    – fudu
    Aug 1 '18 at 7:49











  • can you post your InstallSchema.php file in here ?

    – Marius
    Aug 1 '18 at 7:52











  • Ok, hold on, i'm editing

    – fudu
    Aug 1 '18 at 7:56













0












0








0


1






Like i said in the title, i dont know how the Search in Catalog work.



As far as i know, the Search is render through this code in this ui-component:



C:xampphtdocsmagentovendormagentomodule-cmsviewadminhtmlui_componentcms_page_listing.xml

<filterSearch name="fulltext"/>


And when i copy this code and paste to my ui-component, it doesn't work at all, i can render the search text box, but when i write something and push "Enter", nothing happened.



enter image description here



EDIT 1:



(Here is my ui-component, InstallSchema and UpgradeSchema file)



File : C:xampphtdocsmagentoappcodeAhtBannerSliderviewadminhtmlui_componentbanner_form.xml



<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">banner_form.banner_form_data_source</item>
</item>
<item name="label" xsi:type="string" translate="true">General Information</item>
<item name="template" xsi:type="string">templates/form/collapsible</item>
</argument>
<settings>
<buttons>
<button name="save_and_continue" class="AhtBannerSliderBlockAdminhtmlBannerEditSaveAndContinueButton"/>
<button name="save" class="AhtBannerSliderBlockAdminhtmlBannerEditSaveButton"/>
<button name="reset" class="AhtBannerSliderBlockAdminhtmlBannerEditResetButton"/>
<button name="delete" class="AhtBannerSliderBlockAdminhtmlBannerEditDeleteButton"/>
<button name="back" class="AhtBannerSliderBlockAdminhtmlBannerEditBackButton"/>
</buttons>
<namespace>banner_form</namespace>
<dataScope>data</dataScope>
<deps>
<dep>banner_form.banner_form_data_source</dep>
</deps>
</settings>
<dataSource name="banner_form_data_source">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
</item>
</argument>
<settings>
<submitUrl path="banner/manage/save"/>
</settings>
<dataProvider class="AhtBannerSliderModelBannerDataProvider" name="banner_form_data_source">
<settings>
<requestFieldName>id</requestFieldName>
<primaryFieldName>id</primaryFieldName>
</settings>
</dataProvider>
</dataSource>
<fieldset name="general">
<settings>
<label/>
</settings>
<field name="id" formElement="input">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">banner</item>
</item>
</argument>
<settings>
<dataType>text</dataType>
<visible>false</visible>
<dataScope>id</dataScope>
</settings>
</field>
<field name="name" sortOrder="20" formElement="input">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">banner</item>
</item>
</argument>
<settings>
<validation>
<rule name="required-entry" xsi:type="boolean">true</rule>
</validation>
<dataType>text</dataType>
<label translate="true">Banner Name</label>
<dataScope>name</dataScope>
</settings>
</field>
</fieldset>
</form>


File: InstallSchema.php



class InstallSchema implements MagentoFrameworkSetupInstallSchemaInterface


public function install(MagentoFrameworkSetupSchemaSetupInterface $setup, MagentoFrameworkSetupModuleContextInterface $context)

$installer = $setup;
$installer->startSetup();
if (!$installer->tableExists('banner'))
$table = $installer->getConnection()->newTable(
$installer->getTable('banner')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'name',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
['nullable => false'],
'Name'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Banner Table');
$installer->getConnection()->createTable($table);


if (!$installer->tableExists('slide'))
$table = $installer->getConnection()->newTable(
$installer->getTable('slide')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'banner_id',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
[],
'Banner Id'
)
->addColumn(
'name',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
['nullable => false'],
'Name'
)
->addColumn(
'url',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
[],
'URL'
)
->addColumn(
'image',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
[],
'Image'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Slide Table');
$installer->getConnection()->createTable($table);


$installer->endSetup();






File: UpgradeSchema.php



<?php
namespace AhtBannerSliderSetup;

use MagentoFrameworkSetupUpgradeSchemaInterface;
use MagentoFrameworkSetupSchemaSetupInterface;
use MagentoFrameworkSetupModuleContextInterface;

class UpgradeSchema implements UpgradeSchemaInterface

public function upgrade( SchemaSetupInterface $setup, ModuleContextInterface $context )
$installer = $setup;

$installer->startSetup();

if(version_compare($context->getVersion(), '1.1.0', '<'))

if (!$installer->tableExists('banner_slide'))
$table = $installer->getConnection()->newTable(
$installer->getTable('banner_slide')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'banner_id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
['nullable => false'],
'Banner ID'
)
->addColumn(
'slide_id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
['nullable => false'],
'Slide ID'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Banner Slide Table');

$installer->getConnection()->createTable($table);


if (!$installer->tableExists('banner_page'))
$table = $installer->getConnection()->newTable(
$installer->getTable('banner_page')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'banner_id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
['nullable => false'],
'Banner ID'
)
->addColumn(
'page_url',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
['nullable => false'],
'Page Url'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Banner Page Table');

$installer->getConnection()->createTable($table);


if ($installer->tableExists('slide'))
$connection = $installer->getConnection();
$tableName = $installer->getTable('slide');
$columnName = 'banner_id';
if($connection->tableColumnExists($tableName,$columnName, $schemaName = null))
$connection->dropColumn($tableName, $columnName, $schemaName = null);




$installer->endSetup();




EDIT 2 (fixed in EDIT 3):



I'm following Marius solution.



But it doesn't seem to work. It throw an error when i'm trying "php bin/magento setup:upgrade"



Installing schema... Upgrading schema... SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.banner_name' doesn't exist, query was: DESCRIBE BANNER_NAME



So here is what i update to UpdateSchema.php.



if ($installer->tableExists('banner'))
$connection = $installer->getConnection();
$connection->addIndex(
$setup->getIdxName(
$installer->getTable('banner'),
['name'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['name'],
['type' => AdapterInterface::INDEX_TYPE_FULLTEXT]
);



EDIT 3:



So i was trying Marius solution like this (the difference is i give it a table in "addIndex" function):



if ($installer->tableExists('banner'))
$connection = $installer->getConnection();
$connection->addIndex(
$installer->getTable('banner'),
$setup->getIdxName(
$installer->getTable('banner'),
['name'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['name'],
AdapterInterface::INDEX_TYPE_FULLTEXT
);



Also, before i do that, i have to clear cache and delete my module in "setup_module" table, and it work. But for some reason, when i click "x" to clear the search, it throw 2 column exactly like the same( look the image below):
enter image description here



1 more problem is i cant search with "c". I've read some where that "fulltext_search" cant be use with 5 or less character. So there are any solution to fix this?










share|improve this question
















Like i said in the title, i dont know how the Search in Catalog work.



As far as i know, the Search is render through this code in this ui-component:



C:xampphtdocsmagentovendormagentomodule-cmsviewadminhtmlui_componentcms_page_listing.xml

<filterSearch name="fulltext"/>


And when i copy this code and paste to my ui-component, it doesn't work at all, i can render the search text box, but when i write something and push "Enter", nothing happened.



enter image description here



EDIT 1:



(Here is my ui-component, InstallSchema and UpgradeSchema file)



File : C:xampphtdocsmagentoappcodeAhtBannerSliderviewadminhtmlui_componentbanner_form.xml



<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">banner_form.banner_form_data_source</item>
</item>
<item name="label" xsi:type="string" translate="true">General Information</item>
<item name="template" xsi:type="string">templates/form/collapsible</item>
</argument>
<settings>
<buttons>
<button name="save_and_continue" class="AhtBannerSliderBlockAdminhtmlBannerEditSaveAndContinueButton"/>
<button name="save" class="AhtBannerSliderBlockAdminhtmlBannerEditSaveButton"/>
<button name="reset" class="AhtBannerSliderBlockAdminhtmlBannerEditResetButton"/>
<button name="delete" class="AhtBannerSliderBlockAdminhtmlBannerEditDeleteButton"/>
<button name="back" class="AhtBannerSliderBlockAdminhtmlBannerEditBackButton"/>
</buttons>
<namespace>banner_form</namespace>
<dataScope>data</dataScope>
<deps>
<dep>banner_form.banner_form_data_source</dep>
</deps>
</settings>
<dataSource name="banner_form_data_source">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
</item>
</argument>
<settings>
<submitUrl path="banner/manage/save"/>
</settings>
<dataProvider class="AhtBannerSliderModelBannerDataProvider" name="banner_form_data_source">
<settings>
<requestFieldName>id</requestFieldName>
<primaryFieldName>id</primaryFieldName>
</settings>
</dataProvider>
</dataSource>
<fieldset name="general">
<settings>
<label/>
</settings>
<field name="id" formElement="input">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">banner</item>
</item>
</argument>
<settings>
<dataType>text</dataType>
<visible>false</visible>
<dataScope>id</dataScope>
</settings>
</field>
<field name="name" sortOrder="20" formElement="input">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">banner</item>
</item>
</argument>
<settings>
<validation>
<rule name="required-entry" xsi:type="boolean">true</rule>
</validation>
<dataType>text</dataType>
<label translate="true">Banner Name</label>
<dataScope>name</dataScope>
</settings>
</field>
</fieldset>
</form>


File: InstallSchema.php



class InstallSchema implements MagentoFrameworkSetupInstallSchemaInterface


public function install(MagentoFrameworkSetupSchemaSetupInterface $setup, MagentoFrameworkSetupModuleContextInterface $context)

$installer = $setup;
$installer->startSetup();
if (!$installer->tableExists('banner'))
$table = $installer->getConnection()->newTable(
$installer->getTable('banner')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'name',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
['nullable => false'],
'Name'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Banner Table');
$installer->getConnection()->createTable($table);


if (!$installer->tableExists('slide'))
$table = $installer->getConnection()->newTable(
$installer->getTable('slide')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'banner_id',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
[],
'Banner Id'
)
->addColumn(
'name',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
['nullable => false'],
'Name'
)
->addColumn(
'url',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
[],
'URL'
)
->addColumn(
'image',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
[],
'Image'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Slide Table');
$installer->getConnection()->createTable($table);


$installer->endSetup();






File: UpgradeSchema.php



<?php
namespace AhtBannerSliderSetup;

use MagentoFrameworkSetupUpgradeSchemaInterface;
use MagentoFrameworkSetupSchemaSetupInterface;
use MagentoFrameworkSetupModuleContextInterface;

class UpgradeSchema implements UpgradeSchemaInterface

public function upgrade( SchemaSetupInterface $setup, ModuleContextInterface $context )
$installer = $setup;

$installer->startSetup();

if(version_compare($context->getVersion(), '1.1.0', '<'))

if (!$installer->tableExists('banner_slide'))
$table = $installer->getConnection()->newTable(
$installer->getTable('banner_slide')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'banner_id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
['nullable => false'],
'Banner ID'
)
->addColumn(
'slide_id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
['nullable => false'],
'Slide ID'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Banner Slide Table');

$installer->getConnection()->createTable($table);


if (!$installer->tableExists('banner_page'))
$table = $installer->getConnection()->newTable(
$installer->getTable('banner_page')
)
->addColumn(
'id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
[
'identity' => true,
'nullable' => false,
'primary' => true,
'unsigned' => true,
],
'ID'
)
->addColumn(
'banner_id',
MagentoFrameworkDBDdlTable::TYPE_INTEGER,
null,
['nullable => false'],
'Banner ID'
)
->addColumn(
'page_url',
MagentoFrameworkDBDdlTable::TYPE_TEXT,
255,
['nullable => false'],
'Page Url'
)
->addColumn(
'created_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT],
'Created At'
)->addColumn(
'updated_at',
MagentoFrameworkDBDdlTable::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
'Updated At')
->setComment('Banner Page Table');

$installer->getConnection()->createTable($table);


if ($installer->tableExists('slide'))
$connection = $installer->getConnection();
$tableName = $installer->getTable('slide');
$columnName = 'banner_id';
if($connection->tableColumnExists($tableName,$columnName, $schemaName = null))
$connection->dropColumn($tableName, $columnName, $schemaName = null);




$installer->endSetup();




EDIT 2 (fixed in EDIT 3):



I'm following Marius solution.



But it doesn't seem to work. It throw an error when i'm trying "php bin/magento setup:upgrade"



Installing schema... Upgrading schema... SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.banner_name' doesn't exist, query was: DESCRIBE BANNER_NAME



So here is what i update to UpdateSchema.php.



if ($installer->tableExists('banner'))
$connection = $installer->getConnection();
$connection->addIndex(
$setup->getIdxName(
$installer->getTable('banner'),
['name'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['name'],
['type' => AdapterInterface::INDEX_TYPE_FULLTEXT]
);



EDIT 3:



So i was trying Marius solution like this (the difference is i give it a table in "addIndex" function):



if ($installer->tableExists('banner'))
$connection = $installer->getConnection();
$connection->addIndex(
$installer->getTable('banner'),
$setup->getIdxName(
$installer->getTable('banner'),
['name'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['name'],
AdapterInterface::INDEX_TYPE_FULLTEXT
);



Also, before i do that, i have to clear cache and delete my module in "setup_module" table, and it work. But for some reason, when i click "x" to clear the search, it throw 2 column exactly like the same( look the image below):
enter image description here



1 more problem is i cant search with "c". I've read some where that "fulltext_search" cant be use with 5 or less character. So there are any solution to fix this?







magento2 cms search magento-2.2.5






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 26 mins ago









Teja Bhagavan Kollepara

3,01241949




3,01241949










asked Aug 1 '18 at 7:03









fudufudu

42311




42311












  • In which module it's not working?

    – Suresh Chikani
    Aug 1 '18 at 7:35











  • Thanks for reply, i'm trying to do the search, so the one is not working is my module. I'll edit the post so you can see my ui-component. :)

    – fudu
    Aug 1 '18 at 7:47











  • Edited, please check :D

    – fudu
    Aug 1 '18 at 7:49











  • can you post your InstallSchema.php file in here ?

    – Marius
    Aug 1 '18 at 7:52











  • Ok, hold on, i'm editing

    – fudu
    Aug 1 '18 at 7:56

















  • In which module it's not working?

    – Suresh Chikani
    Aug 1 '18 at 7:35











  • Thanks for reply, i'm trying to do the search, so the one is not working is my module. I'll edit the post so you can see my ui-component. :)

    – fudu
    Aug 1 '18 at 7:47











  • Edited, please check :D

    – fudu
    Aug 1 '18 at 7:49











  • can you post your InstallSchema.php file in here ?

    – Marius
    Aug 1 '18 at 7:52











  • Ok, hold on, i'm editing

    – fudu
    Aug 1 '18 at 7:56
















In which module it's not working?

– Suresh Chikani
Aug 1 '18 at 7:35





In which module it's not working?

– Suresh Chikani
Aug 1 '18 at 7:35













Thanks for reply, i'm trying to do the search, so the one is not working is my module. I'll edit the post so you can see my ui-component. :)

– fudu
Aug 1 '18 at 7:47





Thanks for reply, i'm trying to do the search, so the one is not working is my module. I'll edit the post so you can see my ui-component. :)

– fudu
Aug 1 '18 at 7:47













Edited, please check :D

– fudu
Aug 1 '18 at 7:49





Edited, please check :D

– fudu
Aug 1 '18 at 7:49













can you post your InstallSchema.php file in here ?

– Marius
Aug 1 '18 at 7:52





can you post your InstallSchema.php file in here ?

– Marius
Aug 1 '18 at 7:52













Ok, hold on, i'm editing

– fudu
Aug 1 '18 at 7:56





Ok, hold on, i'm editing

– fudu
Aug 1 '18 at 7:56










1 Answer
1






active

oldest

votes


















4














The general search field in the grid works with full text search indexes. Your table does not have any, that's why nothing happens.

You need to add to your table a full text index that indexes all the fields you want searched.

Here is an example from the cms module



->addIndex(
$setup->getIdxName(
$installer->getTable('cms_block'),
['title', 'identifier', 'content'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['title', 'identifier', 'content'],
['type' => AdapterInterface::INDEX_TYPE_FULLTEXT]
);


This means that you are creating a full text index on the fields title, identifier and content for the cms block entity.






share|improve this answer























  • well , I'm trying to follow your code, but it return an error " Installing schema... Upgrading schema... SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.banner_name' doesn't exist, query was: DESCRIBE BANNER_NAME "

    – fudu
    Aug 1 '18 at 8:39











  • I was replaced "cms_block" with "banner" and " 'title', 'identifier', 'content' " with "name". That's all.

    – fudu
    Aug 1 '18 at 8:40












  • I've updated the code, please check

    – fudu
    Aug 1 '18 at 8:52











  • I have no idea where that banner_name comes from.

    – Marius
    Aug 1 '18 at 8:57











  • hmmm .. This is weird @@ incase you wanna know the code, i've update the UpgradeSchema.php in my post.

    – fudu
    Aug 1 '18 at 9:00











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f236731%2fmagento-2-2-5-how-cms-page-search-work%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














The general search field in the grid works with full text search indexes. Your table does not have any, that's why nothing happens.

You need to add to your table a full text index that indexes all the fields you want searched.

Here is an example from the cms module



->addIndex(
$setup->getIdxName(
$installer->getTable('cms_block'),
['title', 'identifier', 'content'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['title', 'identifier', 'content'],
['type' => AdapterInterface::INDEX_TYPE_FULLTEXT]
);


This means that you are creating a full text index on the fields title, identifier and content for the cms block entity.






share|improve this answer























  • well , I'm trying to follow your code, but it return an error " Installing schema... Upgrading schema... SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.banner_name' doesn't exist, query was: DESCRIBE BANNER_NAME "

    – fudu
    Aug 1 '18 at 8:39











  • I was replaced "cms_block" with "banner" and " 'title', 'identifier', 'content' " with "name". That's all.

    – fudu
    Aug 1 '18 at 8:40












  • I've updated the code, please check

    – fudu
    Aug 1 '18 at 8:52











  • I have no idea where that banner_name comes from.

    – Marius
    Aug 1 '18 at 8:57











  • hmmm .. This is weird @@ incase you wanna know the code, i've update the UpgradeSchema.php in my post.

    – fudu
    Aug 1 '18 at 9:00















4














The general search field in the grid works with full text search indexes. Your table does not have any, that's why nothing happens.

You need to add to your table a full text index that indexes all the fields you want searched.

Here is an example from the cms module



->addIndex(
$setup->getIdxName(
$installer->getTable('cms_block'),
['title', 'identifier', 'content'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['title', 'identifier', 'content'],
['type' => AdapterInterface::INDEX_TYPE_FULLTEXT]
);


This means that you are creating a full text index on the fields title, identifier and content for the cms block entity.






share|improve this answer























  • well , I'm trying to follow your code, but it return an error " Installing schema... Upgrading schema... SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.banner_name' doesn't exist, query was: DESCRIBE BANNER_NAME "

    – fudu
    Aug 1 '18 at 8:39











  • I was replaced "cms_block" with "banner" and " 'title', 'identifier', 'content' " with "name". That's all.

    – fudu
    Aug 1 '18 at 8:40












  • I've updated the code, please check

    – fudu
    Aug 1 '18 at 8:52











  • I have no idea where that banner_name comes from.

    – Marius
    Aug 1 '18 at 8:57











  • hmmm .. This is weird @@ incase you wanna know the code, i've update the UpgradeSchema.php in my post.

    – fudu
    Aug 1 '18 at 9:00













4












4








4







The general search field in the grid works with full text search indexes. Your table does not have any, that's why nothing happens.

You need to add to your table a full text index that indexes all the fields you want searched.

Here is an example from the cms module



->addIndex(
$setup->getIdxName(
$installer->getTable('cms_block'),
['title', 'identifier', 'content'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['title', 'identifier', 'content'],
['type' => AdapterInterface::INDEX_TYPE_FULLTEXT]
);


This means that you are creating a full text index on the fields title, identifier and content for the cms block entity.






share|improve this answer













The general search field in the grid works with full text search indexes. Your table does not have any, that's why nothing happens.

You need to add to your table a full text index that indexes all the fields you want searched.

Here is an example from the cms module



->addIndex(
$setup->getIdxName(
$installer->getTable('cms_block'),
['title', 'identifier', 'content'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['title', 'identifier', 'content'],
['type' => AdapterInterface::INDEX_TYPE_FULLTEXT]
);


This means that you are creating a full text index on the fields title, identifier and content for the cms block entity.







share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 1 '18 at 8:06









MariusMarius

167k28319686




167k28319686












  • well , I'm trying to follow your code, but it return an error " Installing schema... Upgrading schema... SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.banner_name' doesn't exist, query was: DESCRIBE BANNER_NAME "

    – fudu
    Aug 1 '18 at 8:39











  • I was replaced "cms_block" with "banner" and " 'title', 'identifier', 'content' " with "name". That's all.

    – fudu
    Aug 1 '18 at 8:40












  • I've updated the code, please check

    – fudu
    Aug 1 '18 at 8:52











  • I have no idea where that banner_name comes from.

    – Marius
    Aug 1 '18 at 8:57











  • hmmm .. This is weird @@ incase you wanna know the code, i've update the UpgradeSchema.php in my post.

    – fudu
    Aug 1 '18 at 9:00

















  • well , I'm trying to follow your code, but it return an error " Installing schema... Upgrading schema... SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.banner_name' doesn't exist, query was: DESCRIBE BANNER_NAME "

    – fudu
    Aug 1 '18 at 8:39











  • I was replaced "cms_block" with "banner" and " 'title', 'identifier', 'content' " with "name". That's all.

    – fudu
    Aug 1 '18 at 8:40












  • I've updated the code, please check

    – fudu
    Aug 1 '18 at 8:52











  • I have no idea where that banner_name comes from.

    – Marius
    Aug 1 '18 at 8:57











  • hmmm .. This is weird @@ incase you wanna know the code, i've update the UpgradeSchema.php in my post.

    – fudu
    Aug 1 '18 at 9:00
















well , I'm trying to follow your code, but it return an error " Installing schema... Upgrading schema... SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.banner_name' doesn't exist, query was: DESCRIBE BANNER_NAME "

– fudu
Aug 1 '18 at 8:39





well , I'm trying to follow your code, but it return an error " Installing schema... Upgrading schema... SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.banner_name' doesn't exist, query was: DESCRIBE BANNER_NAME "

– fudu
Aug 1 '18 at 8:39













I was replaced "cms_block" with "banner" and " 'title', 'identifier', 'content' " with "name". That's all.

– fudu
Aug 1 '18 at 8:40






I was replaced "cms_block" with "banner" and " 'title', 'identifier', 'content' " with "name". That's all.

– fudu
Aug 1 '18 at 8:40














I've updated the code, please check

– fudu
Aug 1 '18 at 8:52





I've updated the code, please check

– fudu
Aug 1 '18 at 8:52













I have no idea where that banner_name comes from.

– Marius
Aug 1 '18 at 8:57





I have no idea where that banner_name comes from.

– Marius
Aug 1 '18 at 8:57













hmmm .. This is weird @@ incase you wanna know the code, i've update the UpgradeSchema.php in my post.

– fudu
Aug 1 '18 at 9:00





hmmm .. This is weird @@ incase you wanna know the code, i've update the UpgradeSchema.php in my post.

– fudu
Aug 1 '18 at 9:00

















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f236731%2fmagento-2-2-5-how-cms-page-search-work%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2

Nissan Patrol Зміст Перше покоління — 4W60 (1951-1960) | Друге покоління — 60 series (1960-1980) | Третє покоління (1980–2002) | Четверте покоління — Y60 (1987–1998) | П'яте покоління — Y61 (1997–2013) | Шосте покоління — Y62 (2010- ) | Посилання | Зноски | Навігаційне менюОфіційний український сайтТест-драйв Nissan Patrol 2010 7-го поколінняNissan PatrolКак мы тестировали Nissan Patrol 2016рвиправивши або дописавши її