Got a curious issue that has become a stumbling block of a project. It’s a real estate site and required a data import from the client’s current property database. Each property is a document with template variables as property attributes.
I carefully imported and matched all of the data into modx_site_content and modx_site_tmplvar_contentvalues tables. Doing spot checks confirmed that the data is there and that the ids of documents and template variables are matching up.
Opening a document in the manager reveals all of the data.
However the documents are not coming up in our Ditto-filter based search results. However if i open a document with imported data and simply save it, then the document shows up in the results.
I have compared a visible document and an invisible document in both modx_site_content and modx_site_tmplvar_contentvalues field by filed to make sure that all of the values are appropriately set. The visible and invisible documents are identical in those 2 tables. But still one shows up and the other one doesn’t. Which leads me to think that there are other table or tables that are being updated when Manager saves a document.
Does anybody know what they are?
Alternatively what else is happening during the document save that could possible affect the search behavior? Obviously something is changing during the save process.
Thanks in advance.
-
☆ A M B ☆
- 24,524 Posts
Clearing the cache, maybe?
To second Susan.
The site cache file wouldn’t be updated during an external import of data.
However, when you edit and save a document it would.
Thanks Susan,
that was one of the first things i tried to no avail.
Thanks bunk58, i think you’re onto something. Is there a way to add documents to cache in bulk rather than going one by one?
-
☆ A M B ☆
- 24,524 Posts
All I can suggest is examining the code in the manager/processors/save_content.processor.php file.
Yes, i’ve already spent some quality time going line by line in there. Nothing unusual, so now i’m leaning towards the cache hypothesis. The documents’ data is valid and in the right tables. If i call the document’s url explicitly it comes up without any issues. But does not come up in the search unless i save it in the manager.
Seems that Ditto uses the siteCache.idx.php file to grab the available parents.
Line 733 of ditto.class.inc.php ( $modx->documentMap )
So I guess your new document are not there.
Untested but you could try backing up your siteCache.idx.php file and having an empty one with just the opening and closing <?php ?> tags.
MODx should rebuild it with the new documents in it.
Well, rebuilding cache did not work.
So i’m resaving all of the 3 thousand documents by hand to meet the deadline.
Curiously Ditto pix up documents on a different page where i’m just listing some random properties. But not in the search.
the site can found here: hc.arctosgroup.com
in the locations menu browse to Bangkok/Central Business District/Ratchadamri and you’ll see several properties listed on the buttom. Then do a search for the same location and you’ll only see 2 properties which i’ve manually resaved in Manager.
let me know if you’d like to take a look at the backend and i’ll send you login details.
Are there any differences between the Ditto call parameters on the search results page and the random listing page?
e.g. &showInMenuOnly, &showInMenuOnly, &hideFolders etc.
Looks like the only difference is the use of filters in our search snippet which i attached to this post.
But this difference doesn’t seem to account for a document not being included in the search results until it is saved in the manager.