Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@u-mulder
Created April 26, 2017 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save u-mulder/8969a6cc1172a4c20ad51a759211b53f to your computer and use it in GitHub Desktop.
Save u-mulder/8969a6cc1172a4c20ad51a759211b53f to your computer and use it in GitHub Desktop.
Some raw queries to bitrix tables
-- Some queries to bitrix tables
-- `b_option` stores your options
select count(*) from b_option;
-- select options for a certain module
select * from b_option where MODULE_ID = 'module.name';
-- select option for a certain module with a certain name
select * from b_option where MODULE_ID = 'module.name' and NAME ='NAME_GOES_HERE'
-- delete all options for a certain module
delete from b_option where MODULE_ID = 'module.name';
-- get description for some search related tebles:
-- `b_search_content` stores search results
describe b_search_content;
-- `b_search_content_site` stores connection between site and search result from `b_search_content`
describe b_search_content_site;
-- `b_search_content_right` stores connection between user group and search result from `b_search_content`
describe b_search_content_right;
-- `b_search_content_stem` stores stem variants
describe b_search_content_stem;
-- select search results for a certain module (e.g. iblock)
select * from b_search_content where MODULE_ID = 'iblock' -- order by ID desc limit 10;
-- select search results IDs for certain site (e.g. s1)
select * from b_search_content_site where SITE_ID = 's1';
-- selcect items from `b_search_content_right`
select * from b_search_content_right;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment