Elon Report Posted April 29 Posted April 29 (edited) I want to search a title in a database to make sure the record is not already there. I found the different search types I can do: "contenttypes": [ "core_statuses_status", "calendar_event", "cms_pages_pageitem", "cms_records1", "cms_records2", "forums_topic", "nexus_package_item", "links_link" ] What contenttype do I use if I want to search database #3? Edited April 29 by Elon Report
Marc Posted April 29 Posted April 29 Ive moved this to our developer forum for you, which is better placed to get you the answers you need 🙂
Stuart Silvester Posted April 29 Posted April 29 Are you using OAuth tokens? If so, the member you're connecting as most likely doesn't have permission to see the database.
Elon Report Posted April 29 Author Posted April 29 7 hours ago, Stuart Silvester said: Are you using OAuth tokens? If so, the member you're connecting as most likely doesn't have permission to see the database. No, I am using REST API. I tried cms_records3, but that did not work.
Daniel F Posted April 29 Posted April 29 12 hours ago, Elon Report said: search database #3? Are you sure that there's a DB 3? If yes, is it placed on a frontend page?
Elon Report Posted April 29 Author Posted April 29 11 minutes ago, Daniel F said: Are you sure that there's a DB 3? If yes, is it placed on a frontend page? Yes, there is database 3. It is not placed on a page - do I need to do that to access the data?
Elon Report Posted April 29 Author Posted April 29 Yes it is. What contenttype am I looking for if I want to search database 3? Is it supposed to be cms_records3 or something else?
Solution Sonya* Posted April 29 Solution Posted April 29 55 minutes ago, Elon Report said: It is not placed on a page - do I need to do that to access the data? You need a page. The database itself has no url, the page has. If there is no URL, nothing can be accessed or searched. Elon Report and Marc 2
Elon Report Posted April 29 Author Posted April 29 (edited) 58 minutes ago, Sonya* said: You need a page. The database itself has no url, the page has. If there is no URL, nothing can be accessed or searched. That was the solution! I was able to create records without a url though. For anyone else that stumbles with this issue: My database id is 3. My new page id is 4. The contenttype is cms_records3 Thanks all. Edited April 29 by Elon Report Sonya* 1
Elon Report Posted May 3 Author Posted May 3 (edited) OK, I am now trying to search actual data, and running into an issue. Was going to start a new thread but this one was at the top. 🙂 I have a database (#4) on a page, and I am able to upload a record to it. I can see it on the page. However, I always get no results found via the api. {{base_url}}?/core/search&q=2&type=cms_records4 { "page": 1, "perPage": 25, "totalResults": 0, "totalPages": 0, "results": [] } The title is "2". I've tried playing with variables but nothing gets returned when there are no filters at all! Edited May 3 by Elon Report
Sonya* Posted May 3 Posted May 3 Do you use elastic or MySQL search? MySQL cannot search by one character. Elastic - does.
Elon Report Posted May 3 Author Posted May 3 It is MySQL - but I will look into a elastic server! That was not the problem. I changed the title to text, and made the value 00002 Searching produces the same result - none.
Sonya* Posted May 3 Posted May 3 Have you rebuilt search index in ACP? Take a look at core_search_index in your database. Can you see your record there? Elon Report 1
Elon Report Posted May 3 Author Posted May 3 1 hour ago, Sonya* said: Have you rebuilt search index in ACP? Take a look at core_search_index in your database. Can you see your record there? Rebuilding solved the problem. Thanks for the extra troubleshooting tip as well! Sonya* 1
Recommended Posts