ansys.tools.meilisearch.server#
Classes#
Provides the website server for the specified directory on the given port. |
Functions#
|
Scrape the website by collecting the URLs of web pages in the specified 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.
- 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_uid
str
Unique name to assign to the Meilisearch index.
- templates
str
,list
[str
] One or more templates to use. Available templates are
sphinx_pydata
anddefault
.- directory
str
Directory containing the website.
- port
int
Port number to serve the website on.
- stop_urls
str
orlist
[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.
- index_uid
- 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_uid
str
Unique name to give to the Meilisearch index.
- templates
str
,list
[str
] One or more templates to use. Available templates are
sphinx_pydata
anddefault
.- directory
str
Directory to serve and scrape.
- port
int
Port number to listen on.
- stop_urls
str
orlist
[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.
- index_uid