ansys.tools.meilisearch.server#

Classes#

WebsiteServer

Provides the website server for the specified directory on the given port.

Functions#

scrape_website(index_uid, templates, directory, port, ...)

Scrape the website by collecting the URLs of web pages in the specified directory.

local_host_scraping(index_uid, templates, directory, ...)

Perform localhost scraping by serving the directory and scraping its content.

Module Contents#

class ansys.tools.meilisearch.server.WebsiteServer(directory, port)#

Provides the website server for the specified directory on the given port.

Initialize an instance of the website server.

Parameters:
directorystr

Directory to serve.

portint

Port number to listen on.

serve_website()#

Start serving the website.

stop_serving()#

Stop serving the website.

start_serving()#

Start serving the website in a separate thread.

join()#

Wait for the server thread to complete.

ansys.tools.meilisearch.server.scrape_website(index_uid, templates, directory, port, stop_urls)#

Scrape the website by collecting the URLs of web pages in the specified directory.

Parameters:
index_uidstr

Unique name to assign to the Meilisearch index.

templatesstr, list[str]

One or more templates to use. Available templates are sphinx_pydata and default.

directorystr

Directory containing the website.

portint

Port number to serve the website on.

stop_urlsstr or list[str], default: None

A list of stop points when scraping URLs. If specified, crawling will stop when encountering any URL containing any of the strings in this list.

ansys.tools.meilisearch.server.local_host_scraping(index_uid, templates, directory, port, stop_urls)#

Perform localhost scraping by serving the directory and scraping its content.

Parameters:
index_uidstr

Unique name to give to the Meilisearch index.

templatesstr, list[str]

One or more templates to use. Available templates are sphinx_pydata and default.

directorystr

Directory to serve and scrape.

portint

Port number to listen on.

stop_urlsstr or list[str], default: None

A list of stop points when scraping URLs. If specified, crawling will stop when encountering any URL containing any of the strings in this list.