FLEXIcontent / flexicontent-cck

Advanced content management for Joomla
http://www.flexicontent.org
82 stars 53 forks source link

Field data not indexed in Joomla Smart Search #606

Open lyquix-owner opened 8 years ago

lyquix-owner commented 8 years ago

Using Joomla 3.6.0 and FC 3.1.0-rc

It doesn't seem like the values of fields are passed by the Smart Search plugin to the indexer.

ggppdk commented 8 years ago

Yes, we do not pass them, we can do it,

but probably better create individual smart search filters for them too ?

lyquix-owner commented 8 years ago

Ok, I will take a look to see if we can improve the plugin, at least passing the string of all field values. Maybe we can add a setting to the plugin to control if we want to include this data or not.

ggppdk commented 8 years ago

Actual the original effort to support the smart search index

and then tired by the effort, said we can do the rest 5% a little later, but then never did

ggppdk commented 8 years ago

A reason for not doing it,

lyquix-owner commented 8 years ago

For us the big difference is that smart search indexes other components besides com_content and com_flexicontent, and for many of our sites that is needed.

How (and where) do we trigger the FC Smart Fearch plugin and pass indexable data? I can see the plugin https://github.com/FLEXIcontent/flexicontent-cck/blob/master/plugins/finder/flexicontent/flexicontent.php but it doesn't seem to do much there.

If you give me some guidance I can do some local test and come back with a more specific suggestion.

ggppdk commented 8 years ago

In plugin manager, filter by finder plugins

lyquix-owner commented 8 years ago

Yes, I know that, I meant where in the code :-)

lyquix-owner commented 7 years ago

@ggppdk : I am testing the following modifications:

On /plugins/finder/flexicontent/flexicontent.php, before line 269

$item->body = FinderIndexerHelper::prepareContent($item->body, $item->params);

I added the following lines:

$fcitemmodel = new FlexicontentModelItem();
$fcitem = $fcitemmodel->getItem($item->id, $check_view_access=false);
$item->body = $fcitem->search_index;

And after line 332:

include_once JPATH_SITE . '/components/com_flexicontent/helpers/route.php';

I added:

require_once (JPATH_ADMINISTRATOR . '/components/com_flexicontent/defineconstants.php');
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_flexicontent/tables');
require_once(JPATH_SITE . "/components/com_flexicontent/classes/flexicontent.fields.php");
require_once(JPATH_SITE . "/components/com_flexicontent/classes/flexicontent.helper.php");
require_once(JPATH_SITE . "/components/com_flexicontent/models/".FLEXI_ITEMVIEW.".php");

I noticed that $item->body was always blank, so I imagined that passing the search string would be useful. This allows for the basic search strings to be processed by SmartSearch plugin and make their content part of the index. It seems to be working well.

I also tried passing the correct content type on line 299:

$item->addTaxonomy('Type', 'Item');

But $item->type_id always has value 1 and $item->typename and $item->typealias are always blank.

lyquix-owner commented 7 years ago

Where it says

require_once(JPATH_SITE . "/components/com_flexicontent/models/" . FLEXI_ITEMVIEW . ".php");

I had to change to:

if(!class_exists('FlexicontentModelItem')) require_once(JPATH_SITE . "/components/com_flexicontent/models/" . FLEXI_ITEMVIEW . ".php");

because I was getting a fatal error on saving items:

PHP Fatal error: Cannot redeclare class FlexicontentModelItem in /srv/www/dev.rothmaninstitute.com/public_html/components/com_flexicontent/models/item.php

ggppdk commented 7 years ago

OK, the smart index plugin should be finished to support the custom field data being indexed

this because it is both

I have added short-term milestone, and higher priority for this

ggppdk commented 7 years ago

Also there should be a parameter for selecting type to be excluded from Smart-search indexer