Instantiate a search page, should one not exist.
555593
public function requireDefaultRecords() {

		parent::requireDefaultRecords();
		$stage = Versioned::get_stage() ?: 'Stage';
		Versioned::set_stage('Stage');

		// Determine whether pages should be created.

		if(!self::config()->create_default_pages) {
			return;
		}

		// This is required to support multiple sites.

		if(ClassInfo::exists(Multisites::class)) {
			foreach(Site::get() as $site) {

				// The problem is that class name mapping happens after this, but we need it right now to query pages.

				if(!SiteTree::get()->filter(array(
					'ClassName' => array(
						ExtensibleSearchPage::class,
						'ExtensibleSearchPage'
					),
					'SiteID' => $site->ID
				))->first()) {

					// Instantiate an extensible search page.

					$page = ExtensibleSearchPage::create();
					$page->ParentID = $site->ID;
					$page->Title = 'Search Page';
					$page->write();
					DB::alteration_message("\"{$site->Title}\" Extensible Search Page", 'created');
				}
			}
		}
		else {

			// The problem is that class name mapping happens after this, but we need it right now to query pages.

			if(!SiteTree::get()->filter('ClassName', array(
				ExtensibleSearchPage::class,
				'ExtensibleSearchPage'
			))->first()) {

				// Instantiate an extensible search page.

				$page = ExtensibleSearchPage::create();
				$page->Title = 'Search Page';
				$page->write();
				DB::alteration_message('"Default" Extensible Search Page', 'created');
			}
		}
		Versioned::set_stage($stage);
	}
341928
def __query_safebrowsing(self, search_value, search_type):
        
        return json.loads(
                self.session.post(
                    self.url,
                    json=self.__prepare_body(
                        search_value=search_value,
                        search_type=search_type
                    )
                ).text
            )
1077831
def search(self, query, page=0, order=7, category=0, multipage=False):
        
        search = Search(self.base_url, query, page, order, category)
        if multipage:
            search.multipage()
        return search
641732
function shouldLoadPage(index) {
        var page = pages[index];

        // does the page exist?
        if (page) {

            // within page load range?
            if (indexInRange(index)) {
                return true;
            }

            // is it visible?
            if (pageIsVisible(index)) {
                return true;
            }
        }

        return false;
    }
1272056
def search(self, query, fields=None, page=1, max_records=None, flatten=True):
        """"""
        if fields is None:
            fields = []
        page = int(page)
        pages = float('inf')
        data = {
            "query": query,
            "page": page,
            "fields": fields,
            "flatten": flatten
        }

        count = 0
        while page <= pages:
            payload = self._post(self.search_path, data=data)
            pages = payload['metadata']['pages']
            page += 1
            data["page"] = page

            for result in payload["results"]:
                yield result
                count += 1
                if max_records and count >= max_records:
                    return
594519
def create_page(slug, post_data):
        '''
        
        '''
        logger.info('Call create Page')
        if MWiki.get_by_uid(slug):
            return False

        title = post_data['title'].strip()
        if len(title) < 2:
            return False
        return MWiki.__create_rec(slug, '2', post_data=post_data)
1043128
function(client, initialData, totalLength, requestOptions, successStatuses, successRootKeys, promise) {
    this.currentPage = 1; // default to start at page 1
    // this.perPage = queryParams && queryParams.per_page || 25; // default to 25 per page
    this.totalLength = totalLength;
    // bootstrap with initial data
    this.push.apply(this, initialData);

    this.client = client;
    this.requestOptions = requestOptions;
    this.successStatuses = successStatuses;
    this.successRootKeys = successRootKeys;
    this.promise = promise;
  }
1126701
def _init_incremental_search(self, searchfun, init_event):
        
        """
        log("init_incremental_search")
        self.subsearch_query = u''
        self.subsearch_fun = searchfun
        self.subsearch_old_line = self.l_buffer.get_line_text()

        queue = self.process_keyevent_queue
        queue.append(self._process_incremental_search_keyevent)

        self.subsearch_oldprompt = self.prompt

        if (self.previous_func != self.reverse_search_history and
            self.previous_func != self.forward_search_history):
            self.subsearch_query = self.l_buffer[0:Point].get_line_text()

        if self.subsearch_fun == self.reverse_search_history:
            self.subsearch_prompt = u"reverse-i-search%d`%s': "
        else:
            self.subsearch_prompt = u"forward-i-search%d`%s': "

        self.prompt = self.subsearch_prompt%(self._history.history_cursor, "")

        if self.subsearch_query:
            self.line = self._process_incremental_search_keyevent(init_event)
        else:
            self.line = u""
601503
def get_search_page(self, query):
        
        query_web_page = Webpage(self.url + self.parse_query(query))
        query_web_page.get_html_source()  # get html source
        return query_web_page.source
144093
def search(request, template="search_results.html", extra_context=None):
    
    query = request.GET.get("q", "")
    page = request.GET.get("page", 1)
    per_page = settings.SEARCH_PER_PAGE
    max_paging_links = settings.MAX_PAGING_LINKS
    try:
        parts = request.GET.get("type", "").split(".", 1)
        search_model = apps.get_model(*parts)
        search_model.objects.search  # Attribute check
    except (ValueError, TypeError, LookupError, AttributeError):
        search_model = Displayable
        search_type = _("Everything")
    else:
        search_type = search_model._meta.verbose_name_plural.capitalize()
    results = search_model.objects.search(query, for_user=request.user)
    paginated = paginate(results, page, per_page, max_paging_links)
    context = {"query": query, "results": paginated,
               "search_type": search_type}
    context.update(extra_context or {})
    return TemplateResponse(request, template, context)
260546
def handle_request(self, request, *args, **kwargs):
        """"""
        paginator = self.get_paginator()
        # Call search first, it will reset page if search is changed
        search = self.get_search()
        page = self.get_page(paginator)
        items = self.get_items(paginator, page)
        return {
            'search': search,
            'page': page,
            'page_size': self.get_page_size(),
            'num_pages': paginator.num_pages,
            'sort': self.get_sort(),
            'current_fields': self.get_current_fields(),
            'fields': self.get_all_fields(),

            'items': items,
        }
1199222
def _check_can_be_instantiated(cls, cache_location):
        
        if not any(cache_location.startswith(prefix)
                   for prefix in cls._CACHE_URL_PREFIXES):
            raise InvalidCacheException('cache location is not a Fuseki url')

        try:
            from rdflib.plugins.stores.sparqlstore import SPARQLUpdateStore
        except ImportError:
            raise InvalidCacheException('unable to import sparql store')
        del SPARQLUpdateStore
617334
def _delete_from_search_index(*, instance, index):
    """"""
    pre_delete.send(sender=instance.__class__, instance=instance, index=index)
    if settings.auto_sync(instance):
        instance.delete_search_document(index=index)
135035
private Boolean existsPage(String page) throws MalformedURLException {
        // Searching the page...
        LOGGER.debug("Searching page [{}]...", page);
        LOGGER.debug("Page's real path is [{}]", this.context.getRealPath(page));
        File file = new File(this.context.getRealPath(page));
        Boolean exists = file.exists();
        LOGGER.debug("Page [{}]{}found", page, (exists ? " " : " not "));
        return exists;
    }
305409
def handle_not_found(exception, **extra):
    """"""
    assert isinstance(exception, NotFound)

    page = Page.query.filter(db.or_(Page.url == request.path,
                                    Page.url == request.path + "/")).first()

    if page:
        _add_url_rule(page.url)
        return render_template(
            [
                page.template_name,
                current_app.config['PAGES_DEFAULT_TEMPLATE']
            ],
            page=page
        )
    elif 'wrapped' in extra:
        return extra['wrapped'](exception)
    else:
        return exception
617143
def search(self, q, field=None, page=None, per_page=None):
        """"""

        def picker(results):
            if type(results['result']) == list:
                return results['result']
            else:
                return [results['result']]

        return self._get(('search',), picker, q=q, field=field, page=page, per_page=per_page)
1310811
def search(self, term=None, category=None, pages=1, url=search_url,
				sort=None, order=None):
		""""""

		if not self.current_url:
			self.current_url = url

		if self.current_url == Search.base_url:
			# Searching home page so no formatting
			results = self._get_results(self.current_url)
			self._add_results(results)
		else:

			search = self._format_search(term, category)
			sorting = self._format_sort(sort, order)

			# Now get the results.
			for i in range(pages):
				results = self._get_results(search + "/" + str(self._current_page) +
											"/" + sorting)
				self._add_results(results)
				self._current_page += 1
			self._current_page -= 1